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.

The filter Function in Spark DataFrame

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$@7e12bd6b
+----+-------+
| age|   name|
+----+-------+
|null|Michael|
|  30|   Andy|
|  19| Justin|
+----+-------+

null

Filtering

+---+----+
|age|name|
+---+----+
| 30|Andy|
+---+----+

null
import org.apache.spark.sql.Column greaterThan: (column: org.apache.spark.sql.Column, v: Int)org.apache.spark.sql.Column
+---+----+
|age|name|
+---+----+
| 30|Andy|
+---+----+

null
+---+----+
|age|name|
+---+----+
| 30|Andy|
+---+----+

null
+---+----+
|age|name|
+---+----+
| 30|Andy|
+---+----+

null
+---+----+
|age|name|
+---+----+
+---+----+

null
+---+----+
|age|name|
+---+----+
| 30|Andy|
+---+----+

null
+----+-------+
| age|   name|
+----+-------+
|null|Michael|
+----+-------+

null