Skip to content

LIST BUCKETS

Return a complete or partial list of the sub-folders within a bucket.

The LIST BUCKETS command returns the name of each object, its size (in bytes), when it was created, and when it was last modified. The size and creation time may not be available for all objects. This command is an alternative to LIST OBJECTS, which returns a more extensive list of folders and files in object storage.

LIST BUCKETS
EXTERNAL LOCATION name
[ PREFIX (prefix) ]
[ LIMIT limit ]
EXTERNAL LOCATION

Name of an external location object. See CREATE EXTERNAL LOCATION.

PREFIX

Optional prefix string that filters the list of objects. You can specify a folder name or a common prefix that is used for a set of files. For example:

PREFIX ('healthcare')
PREFIX ('healthcare/allergies')
PREFIX ('healthcare/allergies_10')
LIMIT

An integer up to 1000 that limits the number of objects returned, given the filters applied.

Parent topic:SQL Commands