40. [Activity] Using SparkSQL
Activity
Looking At The Code
import org.apache.spark.sql._ // Use new SparkSession interface in Spark 2.0
val spark = SparkSession
.builder
.appName("SparkSQL")
.master("local[*]")
.config("spark.sql.warehouse.dir", "file:///C:/temp") // Necessary to work around a Windows bug in Spark 2.0.0; omit if you're not on Windows.
.getOrCreate()
val lines = spark.sparkContext.textFile("../fakefriends.csv")
val people = lines.map(mapper)Last updated