Skip to content

Instantly share code, notes, and snippets.

@leelakrishna
Created July 17, 2015 06:50
Show Gist options
  • Save leelakrishna/e0f832a315ec8eba80a1 to your computer and use it in GitHub Desktop.
Save leelakrishna/e0f832a315ec8eba80a1 to your computer and use it in GitHub Desktop.
SparkSQl
import sqlContext._
case class Person(name: String, age:Int)
val people = sc.textFile("examples/src/main/resources/ people.txt").map(_.split(",")).map(p => Person(p(0), p(1).trim.toInt))
people.registerAsTable("people")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment