我正在尝试将 Array[Row] 转换为 Array[Int] 但徒劳无功。感谢一些帮助
scala> res17(0).toInt
<console>:30: error: value toInt is not a 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 is not a member of org.apache.spark.sql.Row
res17(0).toArray
^
scala> res17
res30: Array[org.apache.spark.sql.Row] = Array([1,0])
Run Code Online (Sandbox Code Playgroud) 如果我使用下面考虑我不需要参数,它不会在eclipse中检测到Scala.
object HelloWorld {
def main(): Unit = {
println("Hello Scala!!!")
}
}
Run Code Online (Sandbox Code Playgroud)
它工作得很好 args: Array[String]
object HelloWorld {
def main(args: Array[String]): Unit = {
println("Hello Scala!!!")
}
}
Run Code Online (Sandbox Code Playgroud)