cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

File not found error when trying to read json file from aws s3 using with open.

Nagarathna
New Contributor II

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.

 

 

3 REPLIES 3

artsheiko
Databricks Employee
Databricks Employee

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,

Nagarathna
New Contributor II

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()

NandiniN
Databricks Employee
Databricks Employee

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!

Screenshot 2024-05-01 at 15.34.30.png

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now