The following code has already been tested as working, as I want it: for example, adding a tuple to an existing sequence (also from tuples)
iter.map { r => // Iterator of org.apache.spark.sql.Row
r.toSeq :+ (outColName,locMap(r.getAs[String](inColName)))
}
However, our build system has it fail on warningturned on and thus produces the code above:
[info] 'compiler-interface' not yet compiled for Scala 2.10.6. Compiling...
[info] Compilation completed in 24.504 s
[error] /home/../Sampling.scala:40: Adapting argument list
by creating a 2-tuple: this may not be what you want.
[error] signature: SeqLike.:+[B >: A, That](elem: B)(implicit bf: scala.collection.generic.CanBuildFrom[Repr,B,That]): That
[error] given arguments: outColName, locMap(r.getAs[String](inColName))
[error] after adaptation: SeqLike.:+((outColName, locMap(r.getAs[String](inColName))): (String, Int))
[error] r.toSeq :+ (outColName,locMap(r.getAs[String](inColName)))
[error] ^
[error] one error found
Now - as already mentioned - this is what I want. But Travisyou need to make happy. So, what is the right call to sign the same —ie is the desired behavior — and avoid the warnings here?
source
share