5

In Databricks' Scala language, the command dbutils.fs.ls lists the content of a directory. However, I'm working on a notebook in Azure Synapse and it doesn't have dbutils package. What is a Spark command corresponding to dbutils.fs.ls?

%%scala
  dbutils.fs.ls("abfss://container@datalake.dfs.core.windows.net/outputs/wrangleddata")
%%spark
  // list the content of a directory. ????
Summer
  • 363
  • 1
  • 4
  • 15

1 Answers1

11

Just use mssparkutils, it's a rough equivalent and the main documentation page is here. A simple example:

mssparkutils.fs.ls("/")
mssparkutils.fs.ls("abfss://container@datalake.dfs.core.windows.net/outputs/wrangleddata")
wBob
  • 13,710
  • 3
  • 20
  • 37