cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Coursera Apache SQL Course

nir777
New Contributor II

Hi, I have enrolled into Databricks Apache Spark SQL for Data Analysts course on Coursera.
I am in Module 3, I imported the file through given url in course material. In 3.2Basic Queries  I ran the first block which contains following command  "%run ../Includes/Classroom-Setup".
Its running well, but when I try to run next cell i.e create table command I am getting error. I am new to all this please guide me to solve the error ASAP. Attaching a screenshot for reference. Thank you!

 

query_error.png

7 REPLIES 7

filipniziol
Contributor

Hi @nir777 ,

Run "%fs ls /mnt/training/dataframes/" to see whether you see the file in the folder.
Run "%fs head /mnt/training/dataframes/people-10m.parquet" to see whether you can access the content.

We need to make sure first the file is in the location and also that you have the permissions to access it.

nir777
New Contributor II

Hi @filipniziol thanks for your answer. I tried the commands but its showing 
AccessDeniedException . I don't know how to get permissions.  

filipniziol
Contributor

Hi @nir777 ,

Have you mounted your s3 bucket correctly?
Could you just run %fs ls /mnt/training and see whether you can see the files or folders?
What is happening: 

1. The path is incorrect. So /mnt/training is mounted correctly, but the file is in different folder

2. The file is missing

3. The s3 buckte is mounted incorrectly.

nir777
New Contributor II

Hi @filipniziol, sharing a screenshot as q1.pngI am not getting what exactly it means.

filipniziol
Contributor

The first line is incorrect, it would need to be %fs ls /mnt/training instead of %python ls /mnt/training.
So you have this mounted:

filipniziol_0-1726599896927.png

Are you able to run below code and see the content:

# List the contents of /mnt/training
display(dbutils.fs.ls("/mnt/training"))

filipniziol
Contributor

If you get AccessDeniedException when trying to list "/mnt/training", then I would:

1. unmount the directory:

 

dbutils.fs.unmount("/mnt/training")

 

2. mount the directory once again - check the docs:

 

access_key = "<aws-access-key>"
secret_key = "<aws-secret-key>"
encoded_secret_key = secret_key.replace("/", "%2F")
aws_bucket_name = "<aws-bucket-name>"
mount_name = "<mount-name>"

dbutils.fs.mount(f"s3a://{access_key}:{encoded_secret_key}@{aws_bucket_name}", f"/mnt/{mount_name}")
display(dbutils.fs.ls(f"/mnt/{mount_name}"))

 

 

OwenChen
New Contributor II

Hi, I enrolled in the same coursera "databricks" course, and met the same issue. 

I unmounted and re-run the classroom set up as following

OwenChen_1-1727982085219.png

 

However, when I move forward to list the mounted dirctory, the same issue happened.

OwenChen_0-1727981997878.png

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group