sparkR操作HDFS上面的CSV文件

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


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)

posted @ 2016-03-01 14:24  高兴的博客  阅读(2335)  评论(2编辑  收藏  举报