Spark SQL "No input paths specified in job",但是可以打印Schema

Spark SQL "No input paths specified in job", but can printSchema

我可以阅读 Json 和 printSchema,但是 运行 任何操作都失败(作业中未指定输入路径)。

val sc = new org.apache.spark.SparkContext("local[*]", "shell")
val sqlCtx = new SQLContext(sc)
val input = sqlCtx.jsonFile("../data/tweets/")
input.printSchema

root
|-- contributorsIDs: array (nullable = true)
| |-- element: string (containsNull = true)
|-- createdAt: string (nullable = true)
...

input.first
java.io.IOException: No input paths specified in job

文件夹结构如下:

备注:

好的,通过指定路径解决问题

val input = sqlCtx.jsonFile("../data/tweets/tweets_*/*")