cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Where / how does DBFS store files?

al_joe
Contributor

I tried to use %fs head to print the contents of a CSV file used in a training

%fs head "/mnt/path/file.csv"

but got an error saying cannot head a directory!?

Then I did %fs ls on the same CSV file and got a list of 4 files under a directory named as a CSV file.

screenshot 

A little confused how DBFS stores files on underlying storage and where they are stored. I am using community edition.

any pointers appreciated. Thanks.

EDIT: Apache iceberg has a illustration that shows the internal logical/storage structure well. Is there something similar for DBFS? 

image 

2 REPLIES 2

Chris_Shehu
Valued Contributor III

Is this a fresh cluster startup? I noticed that if you browse tot he location using the UI you get a prompt asking you to attach a cluster on the first startup. I would make sure that's setup and make sure you can see it in the directory.

image 

Also have you tried loading the csv into pandas to display it?

User16753725182
Databricks Employee
Databricks Employee

Hi @Al Jo​ , are you still seeing the error while printing the contents of te CSV file?

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