File not found error when trying to read json file from aws s3 using with open.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 12:36 AM
I am trying to reading json from aws s3 using with open in databricks notebook using shared cluster.
Error message:No such file or directory:'/dbfs/mnt/datalake/input_json_schema.json'
In single instance cluster the above error is not found.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 05:05 AM
Hey,
Please consider to use Unity Catalog with Volumes.
You'll find a quickstart notebook here : https://docs.databricks.com/en/connect/unity-catalog/volumes.html#tutorial-unity-catalog-volumes-not...
Hope it helps,
Best,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 10:12 PM
Hey,
Thanks for suggesting this approach.
But I want to know why the json file cannot be read from AWS S3 bucket using "with open" in python with shared instance mode cluster.
The code works perfectly fine if I'm using a single instance mode cluster.
code:
with open("/dbfs/mnt/datalake/input.json","r") as f:
data = f.read()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 03:07 AM
Hi @Nagarathna ,
I just tried it on a shared cluster and did not face any issue. What is the exact error that you are facing? Complete stacktrace might help. Just to confirm are you accessing the "/dbfs/mnt/datalake/input.json" from the same workspace when trying out the cluster modes?
Thanks!