January 2019
Beginner to intermediate
154 pages
4h 31m
English
To start with, we need a Spark session object, which will be used to convert RDDs into DataFrames, or to load data directly from a file into a DataFrame.
We are using the sales dataset in this chapter. You can get the dataset file, along with the code files for this chapter, from the following link: https://github.com/PacktPublishing/Apache-Spark-Quick-Start-Guide:
//Scalaimport org.apache.spark.sql.SparkSessionval spark = SparkSession.builder().appName("Spark DataFrame example").config("spark.some.config.option", "value").getOrCreate()// For implicit conversions like converting RDDs to DataFramesimport spark.implicits._//Javaimport org.apache.spark.sql.SparkSession;SparkSession spark = SparkSession.builder().appName("Java ...Read now
Unlock full access