Skip to content

Instantly share code, notes, and snippets.

@josep2
Created April 19, 2017 20:33
Show Gist options
  • Save josep2/ec1b22b59a1ea6ef7821bb9dbd14142e to your computer and use it in GitHub Desktop.
Save josep2/ec1b22b59a1ea6ef7821bb9dbd14142e to your computer and use it in GitHub Desktop.
// Start your Livy server: https://github.com/cloudera/livy#prerequisites
// First step is I instantiate a Spark Session and create a function that square in the spark shell and leave it open
val sparkSession = SparkSession.builder
.master("local[1]")
.appName("app_1")
.getOrCreate()
def predictMyWeight(weight: Int, calories: Int ): Double = {
185 + .005*weight -*002*calories // Don't make fun of my default weight
}
---------------------------------------------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment