-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sbt
29 lines (26 loc) · 892 Bytes
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import Dependencies._
lazy val root = (project in file(".")).
settings(
inThisBuild(List(
organization := "com.example",
scalaVersion := "2.12.13",
version := "0.1.0-SNAPSHOT"
)),
name := "SparkExample",
libraryDependencies += "org.apache.spark" %% "spark-core" % "3.0.1",
libraryDependencies += "org.apache.spark" %% "spark-sql" % "3.0.1",
libraryDependencies += scalaTest % Test
)
initialCommands in console := """
import org.apache.log4j.{Level, Logger}
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.functions._
Logger.getLogger("org.apache.spark").setLevel(Level.WARN)
val spark = SparkSession.builder
.master("local[*]")
.appName("spark-shell")
.getOrCreate
import spark.implicits._
lazy val sc = spark.sparkContext
"""
cleanupCommands in console := "if (spark != null) spark.stop()"