Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Loading...
Loading...
org.apache.spark.sql.SparkSession$implicits$@78b8022e
+-----+-----+-----+
|fname|lname|score|
+-----+-----+-----+
|  Ben|   Du|    1|
|  Ben|   Du|    2|
|  Ben|   Tu|    3|
|  Ben|   Tu|    4|
|  Ken|   Xu|    1|
|  Ken|   Xu|    9|
+-----+-----+-----+

null

Get the First Row

[Ben,Du,1]

Get the first element of the first row as String.

Ben

Construct a Row

[1,how,i,2.0]
[1,how,true,2.0]

Get Elements of a Row

[1,how,i,2.0]
1
java.lang.ClassCastException: java.lang.Integer cannot be cast to scala.runtime.Nothing$
  ... 52 elided
how
java.lang.ClassCastException: java.lang.String cannot be cast to scala.runtime.Nothing$
  ... 52 elided