05-15-2023 02:48 PM
I need help understanding why I can't open a file.
In a databricks notebook, I use this code:
%fs
ls /mnt/cntnr/demo
I get back dbfs:/mnt/cntnr/demo/circuits.csv as one of the path values.
When I use this code, I get an error:
circuits_df = spark.read.csv("dbfs:/mnt/cntnr/demo/circuits.csv")
Any suggestions?
ANy suggestion
06-05-2023 11:14 PM
Try this
circuits_df = spark.read.csv("/dbfs/mnt/cntnr/demo/circuits.csv")
05-15-2023 10:38 PM
@jch
Try spark.read.csv without dbfs:
You can learn more here:
05-18-2023 08:54 AM
This didn't work either
circuits_df = spark.read.csv("/mnt/cntnr/demo/circuits.csv")
06-05-2023 11:14 PM
Try this
circuits_df = spark.read.csv("/dbfs/mnt/cntnr/demo/circuits.csv")
06-21-2023 05:56 AM
It turns out my spark config was wrong
#Set Spark configuration
configs = {"fs.azure.account.auth.type": "OAuth",
"fs.azure.account.oauth.provider.type": "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider",
"fs.azure.account.oauth2.client.id": client_ID,
"fs.azure.account.oauth2.client.secret": client_secret,
"fs.azure.account.oauth2.client.endpoint": f"https://login.microsoftonline.com/{tenant_ID}/oauth2/token"}
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.