loading data into spark dataframe from csv code example
Example 1: read csv in spark
df = spark.read.format("csv").option("header", "true").load("csvfile.csv")
Example 2: read csv in spark
df = spark. read . format("csv") . option("header", "true")