When I tried to get some values in a DataFrame, like:
DataFrame
df.select(\"date\").head().get(0) // type: Any
The result type is Any<
Any<
You can call the generic getAs method as getAs[Int](columnIndex), getAs[String](columnIndex) or use specific methods like getInt(columnIndex), getString(columnIndex).
getAs
getAs[Int](columnIndex)
getAs[String](columnIndex)
getInt(columnIndex)
getString(columnIndex)
Link to the Scaladoc for org.apache.spark.sql.Row.