Skip to main content

MD_LIST_FILES

MD_LIST_FILES() lists files and folders at a cloud storage path.

note

MD_LIST_FILES() supports:

  • s3://
  • azure://
  • az://

It does not accept r2://, gcs://, or gs:// paths, but MotherDuck can still query those storage providers normally.

Syntax

FROM md_list_files('<path>');

Output

Column NameData TypeValue
nameVARCHARFile or folder name relative to the requested prefix
typeVARCHAREntry type, such as FILE or FOLDER
sizeUBIGINTFile size in bytes; NULL for folders
last_modifiedTIMESTAMP WITH TIME ZONELast modification time; NULL for folders

Example usage

FROM md_list_files('s3://us-prd-motherduck-open-datasets/');
FROM md_list_files('azure://my-container/raw/');

Notes