Created
January 29, 2019 14:50
-
-
Save pedroduartecosta/79444bd7b654be94e9239d9664dd0746 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 conf = new SparkConf().setAppName("predictor") | |
val sc = new SparkContext(conf) | |
val sqlContext = new SQLContext(sc) | |
val rawData = sqlContext.read.format("com.databricks.spark.csv") | |
.option("header", "true") | |
.option("inferSchema", "true") | |
.load(dataPath) | |
.withColumn("DelayOutputVar", col("ArrDelay").cast("double")) | |
.withColumn("DepDelayDouble", col("DepDelay").cast("double")) | |
.withColumn("TaxiOutDouble", col("TaxiOut").cast("double")) | |
.cache() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment