Created
May 27, 2021 10:19
-
-
Save mkarmona/45b94958530c773b3ae620ded092a8db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import coursierapi._ | |
| interp.repositories() ++= Seq( | |
| MavenRepository | |
| .of("http://dl.bintray.com/spark-packages/maven") | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import $file.resolvers | |
| import $ivy.`org.apache.spark::spark-core:3.1.1` | |
| import $ivy.`org.apache.spark::spark-sql:3.1.1` | |
| import $ivy.`org.apache.spark::spark-mllib:3.1.1` | |
| // import $ivy.`org.jgrapht:jgrapht-core:1.5.1` | |
| import org.apache.spark.SparkConf | |
| import org.apache.spark.sql._ | |
| import org.apache.spark.sql.types._ | |
| import org.apache.spark.sql.functions._ | |
| // import org.jgrapht._ | |
| // import org.jgrapht.generate._ | |
| // import org.jgrapht.traverse._ | |
| // import org.jgrapht.graph._ | |
| // import org.jgrapht.util._ | |
| object SparkSessionBuilder { | |
| def apply(log: String = "WARN"): SparkSession = { | |
| val sparkConf = new SparkConf() | |
| .set("spark.driver.maxResultSize", "0") | |
| .setAppName("similarities-loaders") | |
| .setMaster("local[*]") | |
| val ss = SparkSession.builder | |
| .config(sparkConf) | |
| .getOrCreate | |
| ss.sparkContext.setLogLevel(log) | |
| ss | |
| } | |
| } | |
| val spark = SparkSessionBuilder() | |
| import spark.implicits._ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment