Skip to content

Instantly share code, notes, and snippets.

@amelio-vazquez-reina
Created October 29, 2015 15:51
Show Gist options
  • Save amelio-vazquez-reina/d611baebe897ee97fe48 to your computer and use it in GitHub Desktop.
Save amelio-vazquez-reina/d611baebe897ee97fe48 to your computer and use it in GitHub Desktop.
val sqlCtx = new org.apache.spark.sql.hive.HiveContext(sc)
val results = sqlCtx.sql(
"SELECT * FROM events where d='26022015' and pmessage_type='attribution' limit 100")
results.map(t => "Name: " + t(0)).collect().foreach(println)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment