简体   繁体   English

HDFS URI不完整,不存在主机,Altohugh文件确实存在

[英]Incomplete HDFS URI, no host, altohugh file does exist

i'm trying to access via pyspark to my files in hdfs with the following code: 我正在尝试通过pyspark使用以下代码访问hdfs中的文件:

spark = SparkSession.builder.appName("MongoDBIntegration").getOrCreate()
receipt = spark.read.json("hdfs:///bigdata/2.json")

and i get an error Incomplete HDFS URI, no host: hdfs:///bigdata/2.json 而且我收到一个错误, Incomplete HDFS URI, no host: hdfs:///bigdata/2.json

but if i write the command hdfs dfs -cat /bigdata/1.json it does print me my file 但是如果我写命令hdfs dfs -cat /bigdata/1.json它的确会打印我的文件

The error message says that you have not specified the host in the HDFS URI. 该错误消息表明您尚未在HDFS URI中指定主机。

Try to change the URI with: 尝试使用以下方法更改URI:

hdfs://<HDFS_HOST>:<HDFS_PORT>/bigdata/2.json

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM