且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

org.apache.spark.sql.Row为Int

更新时间:2023-11-18 14:27:28

***的文档是源

Row.scala

  /**
   * Returns the value of column `i` as an int.  This function will throw an exception if the value
   * is at `i` is not an integer, or if it is null.
   */
  def getInt(i: Int): Int =
    row.getInt(i)

适用于你的例子:

Applied to your example:

num = num_en.collect()(0).getInt(0)