Databricks icon

Databricks

Interact with Databricks API

Files → List Directory

AI-generated

Overview

This node operation lists the contents of a directory within a specified volume in Databricks Unity Catalog. It is useful for retrieving file and folder information inside a volume, supporting pagination through page size and page token parameters. Practical use cases include browsing files in a data catalog volume or automating file management workflows.

Use Case Examples

  1. List all files and subdirectories in a specific directory within a Unity Catalog volume.
  2. Paginate through large directories by specifying page size and page token to retrieve files in batches.

Properties

Name Meaning
Volume Path Full path to the volume in the format catalog.schema.volume, specifying the target volume to list the directory from.
Directory Path Path to the directory within the volume to list, relative to the volume root, without a leading slash.
Page Size Number of files to return per page, used for pagination.
Page Token Token for the next page of results, used for pagination.

Output

JSON

  • files - List of files and directories returned from the directory listing API call
  • next_page_token - Token for fetching the next page of results if pagination is used

Dependencies

  • Databricks API with an API token for authentication

Troubleshooting

  • Ensure the volume path is correctly formatted as catalog.schema.volume; otherwise, an error is thrown.
  • Check API credentials and network connectivity if API requests fail.
  • If pagination parameters are incorrect, the listing may not return expected results.

Links

  • Databricks Files API - Official documentation for managing files in Databricks Unity Catalog volumes.

Discussion