cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Databricks connect to GCS

James1100
New Contributor II

Hi,

Would like to ask if anyone knows how to connect to GCS - basically read csv file from GCS bucket.

I have no issue connecting to Data Lake.

Thank you so much in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz
Community Manager
Community Manager

Hi @James C​ , 

read_csv 
 

supports reading directly from Google Cloud Storage.

Simply provide a link to the bucket like this:

df = pd.read_csv('gs://bucket/your_path.csv')

The read_csv will then use gcsfs module to read the DataFrame, which means it had to be installed (or you will get an exception pointing at missing dependency).

View solution in original post

2 REPLIES 2

Kaniz
Community Manager
Community Manager

Hi @James C​ , 

read_csv 
 

supports reading directly from Google Cloud Storage.

Simply provide a link to the bucket like this:

df = pd.read_csv('gs://bucket/your_path.csv')

The read_csv will then use gcsfs module to read the DataFrame, which means it had to be installed (or you will get an exception pointing at missing dependency).

Vartika
Moderator
Moderator

Hi @James C​,

Just checking in. If @Kaniz Fatma​'s answer helped, would you let us know and mark the answer as best? If not, would you be happy to give us more information?

We'd love to hear from you.

Cheers!

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.