Skip to content

Commit 843d6ea

Browse files
split example
1 parent 70c22cd commit 843d6ea

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.sparkbyexamples.spark.dataframe
2+
3+
import org.apache.spark.sql.SparkSession
4+
5+
object RemoveNullRowsExample extends App{
6+
7+
val spark: SparkSession = SparkSession.builder()
8+
.master("local[1]")
9+
.appName("SparkByExamples.com")
10+
.getOrCreate()
11+
12+
val filePath="src/main/resources/small_zipcode.csv"
13+
14+
val df = spark.read.options(Map("inferSchema"->"true","delimiter"->",","header"->"true")).csv(filePath)
15+
df.printSchema()
16+
df.show(false)
17+
18+
df.na.drop()
19+
.show(false)
20+
21+
// Array and map columns
22+
}

0 commit comments

Comments
 (0)