object_name (TEXT), object_type (TEXT), object_bytes (BIGINT), and file_timestamp (TIMESTAMPTZ).
Syntax
AWS_ROLE_ARN, set the optional AWS_ROLE_EXTERNAL_ID to add a customer-controlled condition to your role’s trust policy.
For role-based AWS access you can additionally set an external ID. An external ID is a value you choose and control that AWS checks when Firebolt assumes your role, adding a second condition on top of your account’s unique IAM principal. Configuring one is a recommended best practice. See IAM roles.
Parameters
Return Type
The output is a table with four columns:object_name(TEXT)object_type(TEXT)object_bytes(BIGINT)last_modified(TIMESTAMPTZ)
-
object_name: Contains both the full path and the file extension. -
object_type: Can be either “file” or “folder”.-
If
object_type= “folder”, theobject_bytesandlast_modifiedcolumns will containNULLvalues, as folders do not have associated sizes or timestamps. -
If
object_type= “file”, the following apply:- The
last_modifiedcolumn is populated from theLastModifiedattribute in Amazon S3. Note that AWS does not expose the creation timestamp, so the values in this column only differ from the creation time if an immutable object has been overwritten. - The
object_bytescolumn contains the size of the file in bytes.
- The
-
If
Examples
Using LOCATION object to store credentials
Best practice Firebolt recommends using aLOCATION object to store credentials for authentication.
The following code example retrieves all objects from the specified LOCATION using the LIST_OBJECTS function:
The following code example applies an optional pattern with a location:
LIST_OBJECTS recursive.
Using static credentials
The following code examples show how to list all objects (folders) that start with a specified prefix within an Amazon S3 bucket. You can specify either a part of the prefix or the full prefix. For example, the URLs ending with the prefixesfire or firebolt_sample_dataset both return identical results because both are valid matches for the firebolt_sample_dataset folder as follows:
The following code example shows how to list all objects such as files, folders, and associated metadata, that start with a specified prefix in an Amazon S3 bucket:
The following code examples show how to list all objects such as files and associated metadata, that start with a specified prefix in an Amazon S3 bucket. The URLs ending with the prefixes
lev or levels.csv return identical results because both are valid matches for the levels.csv file as follows:
The following code example shows how to use your Amazon credentials to list objects in an Amazon S3 bucket that is not publicly accessible: