0

In azure databricks i have different results for the directory list of dbfs by simply adding two dots. Can anybody explain to me why this happens?

case one

case two

1 Answer 1

2

With dbutils, you can only use "dbfs:/" paths. If you do not specify "dbfs:/" at the start of your path, it will simply auto-add it.

dbutils.fs.ls('pathA')
--> dbfs:/pathA

is exactly the same as

dbutils.fs.ls('dbfs:/pathA')

but if you do not use the ':', then it will add it silently.

dbutils.fs.ls('dbfs/pathB')
--> dbfs:/dbfs/pathB

It means your dbfs/ is considered as a folder name dbfs at the root of your dbfs:/

To avoid confusion, always specify dbfs:/ to your path.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.