na: DataFrameNaFunctions
people.withColumn("expr1", expr("nullif(expr1, expr2)"))
people.sort($"age".desc_nulls_last)
val names = Seq(
(0, null.asInstanceOf[String]), // <-- define a missing name
(1, "hello")).toDF("id", "name")
scala> names.show
+---+-----+
| id| name|
+---+-----+
| 0| null|
| 1|hello|
+---+-----+
val names = Seq(
(0, None), // <-- define a missing name
(1, Some("hello"))).toDF("id", "name")
scala> names.show
+---+-----+
| id| name|
+---+-----+
| 0| null|
| 1|hello|
+---+-----+