Reputation: 494
i'm trying to access via pyspark to my files in hdfs with the following code:
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
but if i write the command hdfs dfs -cat /bigdata/1.json
it does print me my file
Upvotes: 0
Views: 3425
Reputation: 1338
The error message says that you have not specified the host in the HDFS URI.
Try to change the URI with:
hdfs://<HDFS_HOST>:<HDFS_PORT>/bigdata/2.json
Upvotes: 2