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

夙愿已清 提交于 2019-12-11 04:23:15

问题


I have the following error:

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

When I execute the following line:

val df = sqlContext.read.json("file://home/test.json")

Any ideas?


回答1:


If you want to load data from local please use

sqlContext.read.json("file:///home/shankar/test.json")

or just

sqlContext.read.json("/home/shankar/test.json")

will work

If you want to load the file from HDFS use

sqlContext.read.json("hdfs:///user/shankar/test.json")

Hope this helps!



来源:https://stackoverflow.com/questions/43800187/spark-java-io-ioexception-no-input-paths-specified-in-job

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!