LIST

Preview

Unity Catalog is in Public Preview. To participate in the preview, contact your Databricks representative.

Lists the objects immediately contained at the URL.

Since: Databricks Runtime 10.3

Syntax

LIST url [ WITH ( CREDENTIAL credential_name ) ] [ LIMIT limit ]

Parameters

  • url

    A STRING literal with the location of the cloud storage described as an absolute URL.

  • credential_name

    An optional named credential used to access this URL. If you supply a credential it must be sufficient to access the URL. If you do not supply a credential the URL must be contained in an external location to to which you have access.

  • limit

    An optional INTEGER constant between 1 and 1001 used to limit the number of objects returned. The default limit is 1001.

Examples

> LIST 's3://us-east-1-dev/some_dir' WITH (CREDENTIAL aws_some_dir) LIMIT 2
  path                               name   size modification_time is_directory
  ---------------------------------- ------ ---- ----------------- ------------
  s3://us-east-1-dev/some_dir/table1 table1 0    ...               true
  s3://us-east-1-dev/some_dir/table1 table1 0    ...               true