Created
December 28, 2015 09:55
-
-
Save treper/895f6cde128336ec1661 to your computer and use it in GitHub Desktop.
TestHiveSQL-in-SparkShell
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
val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc) | |
import sqlContext.implicits._ | |
val pp = sc.makeRDD(1 to 5).map(i => (i, i * 2)).toDF("single", "double") | |
pp.registerTempTable("people") | |
sqlContext.sql("select concat('test_',single) from people").collect().foreach(println) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment