Skip to content

Commit c4c4740

Browse files
committed
add spark session wrapper to use along in the examples.
1 parent fe89391 commit c4c4740

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.sparkbyexamples.spark
2+
3+
import org.apache.spark.sql.SparkSession
4+
5+
trait SparkSessionWrapper {
6+
lazy val spark: SparkSession = {
7+
SparkSession
8+
.builder()
9+
.master("local")
10+
.appName("spark session")
11+
.config("spark.sql.shuffle.partitions", "1")
12+
.getOrCreate()
13+
}
14+
}

0 commit comments

Comments
 (0)