Commit 96839fea authored by 张彦钊's avatar 张彦钊

增加hive代码

parent 7c7f78a5
...@@ -79,6 +79,7 @@ def test(): ...@@ -79,6 +79,7 @@ def test():
def hive(): def hive():
conf = SparkConf().setMaster("spark://10.31.242.83:7077").setAppName("My app") conf = SparkConf().setMaster("spark://10.31.242.83:7077").setAppName("My app")
sc = SparkContext(conf=conf) sc = SparkContext(conf=conf)
sc.setLogLevel("WARN")
sqlContext = HiveContext(sc) sqlContext = HiveContext(sc)
sql = "select partition_date from online.tl_hdfs_maidian_view limit 10" sql = "select partition_date from online.tl_hdfs_maidian_view limit 10"
my_dataframe = sqlContext.sql(sql) my_dataframe = sqlContext.sql(sql)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment