Step 2 - Creating a Spark session and importing implicits

We then need to create a Spark session as the gateway of our program:

val spark = SparkSession
.builder
.master("local[*]")
.config("spark.sql.warehouse.dir", "tmp/")
.appName("Fraud Detection")
.getOrCreate()

Additionally, we need to import implicits for spark.sql and h2o:

implicit val sqlContext = spark.sqlContext
import sqlContext.implicits._
val h2oContext = H2OContext.getOrCreate(spark)
import h2oContext._
import h2oContext.implicits._
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset