Hello

After I converted the dataframe to RDD I found the data type was missing.


scala> df.show
+----+---+
|name|age|
+----+---+
|jone| 12|
|rosa| 21|
+----+---+


scala> df.printSchema
root
 |-- name: string (nullable = true)
 |-- age: integer (nullable = false)


scala> df.rdd.map{ row => (row(0),row(1)) }.collect
res9: Array[(Any, Any)] = Array((jone,12), (rosa,21))

As you see above, the element's data type becomes (Any,Any).

Can you help with this issue?

Thanks

---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscr...@spark.apache.org

Reply via email to