标签:cloud ges default rom ado init connect tab package
Sys.setenv(HADOOP_CONF_DIR=‘/etc/hadoop/conf.cloudera.hdfs‘)
Sys.setenv(YARN_CONF_DIR=‘/etc/hadoop/conf.cloudera.yarn‘)
library(SparkR, lib.loc = "/opt/modules/spark/R/lib")
library(RHive)
sc <- sparkR.init(sparkHome = "/opt/modules/spark",
sparkPackages="com.databricks:spark-csv_2.10:1.4.0")
sqlContext <- sparkRSQL.init(sc)
rhive.connect("master", defaultFS=‘hdfs://master:8020‘,hiveServer2=TRUE,user="hue")
rhive.query("select * from data.data_orders limit 5")
rhive.close()
标签:cloud ges default rom ado init connect tab package
原文地址:http://www.cnblogs.com/wisetree/p/6700562.html