-
-
Save ppillay/0eed47ce69c5afb093d84ae41833a3fd to your computer and use it in GitHub Desktop.
Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val spark = SparkSession.builder.master("local").appName("flightDataApp").getOrCreate() | |
import spark.implicits._ | |
val df = spark.read | |
.option("header", "true") //read headers | |
.option("mode", "DROPMALFORMED") | |
.option("inferSchema", "true") | |
.csv("flight-data/16157900_T_ONTIME.csv") | |
.na.fill(Map("delay" -> 0.0)) // replace null values in delay column with zero |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment