sparkR操做HDFS上面的CSV文件

./bin/sparkR --packages com.databricks:spark-csv_2.10:1.3.0 --master yarnsql


hdfs://master:9000/tmp/demo.cvs 替換你的hdfs路徑
>sc = sparkR.init(master = "yarn″, appName="SparkR")
>sqlContext = sparkRSQL.init(sc)
>demo = read.df(sqlContext,'hdfs://master:9000/tmp/demo.cvs',source ='com.databricks.spark.csv')
>head(demo)app

相關文章
相關標籤/搜索