scala - how to convert Array[org.apache.spark.sql.Row] to Array[Int] -
i'm trying convert array[row] array[int] in vain. appreciate help
scala> res17(0).toint <console>:30: error: value toint not member of org.apache.spark.sql.row res17(0).toint ^ scala> res17(0) res28: org.apache.spark.sql.row = [1,0] scala> res17(0).toarray <console>:30: error: value toarray not member of org.apache.spark.sql.row res17(0).toarray ^ scala> res17 res30: array[org.apache.spark.sql.row] = array([1,0])
just map
getint
:
val rows: array[row] = ??? rows.map(_.getint(0))
Comments
Post a Comment