我只是想将文本文件读入 pyspark RDD,我注意到sqlContext.read.load
和之间存在巨大差异sqlContext.read.text
。
s3_single_file_inpath='s3a://bucket-name/file_name'
indata = sqlContext.read.load(s3_single_file_inpath, format='com.databricks.spark.csv', header='true', inferSchema='false',sep=',')
indata = sqlContext.read.text(s3_single_file_inpath)
上面的sqlContext.read.load
命令失败了
Py4JJavaError: An error occurred while calling o227.load.
: java.lang.ClassNotFoundException: Failed to find data source: com.databricks.spark.csv. Please find packages at http://spark-packages.org
但是第二个成功了吗?
现在,我对此感到困惑,因为我在网上看到的所有资源都说要使用,sqlContext.read.load
包括这个:https ://spark.apache.org/docs/1.6.1/sql-programming-guide.html 。
我不清楚何时使用这些中的哪一个。这些之间有明确的区别吗?