EXTERNAL_TABLE_FILE_REGISTRATION_HISTORY
functionsupportedIceberg & external tablesThis table function can be used to query information about the metadata history for an external table, including: - Files added or removed automatically as part of a metadata refresh. - Any errors found when refreshing the metadata.
Syntax
supportedpartialnot supportednot scored
EXTERNAL_TABLE_FILE_REGISTRATION_HISTORY (
TABLE_NAME => '<string>'
[, START_TIME => <constant_expr> ] )
Parameters
| Name | Required | Description |
|---|---|---|
TABLE_NAME => 'string' | required | A string specifying an external table name. |
START_TIME => constant_expr | optional | Timestamp (in TIMESTAMP_LTZ format), within the last 30 days, marking the start of the time range for retrieving metadata update events. Note If no start time is specified, the function returns all update events within the last 30 days. If the start time falls outside the last 30 days, the function returns results within the last 30 days. If the start time is not a timestamp, it is ignored. |
Usage notes
- Returns results for the external table owner (i.e. the role with the OWNERSHIP privilege on the external table), or a higher role, or a role that has the USAGE privilege on the database and schema that contain an external table and any privilege on the external table.
- The table function cannot retrieve metadata about staged data files until the external table is refreshed (i.e. synched) to include the data files in its metadata.
- When calling an Information Schema table function, the session must have an INFORMATION_SCHEMA schema in use or the function name must be fully-qualified. For more details, see Snowflake Information Schema.
Output
The function returns the following columns: Column Name | Data Type | Description JOB_CREATED_TIME | TIMESTAMP_LTZ | Timestamp when the operation occurred FILE_NAME | TEXT | Name of the staged source file and relative path to the file OPERATION_STATUS | TEXT | Status: REGISTERED_NEW, REGISTERED_UPDATE, REGISTER_SKIPPED, REGISTER_FAILED, UNREGISTERED, or UNREGISTER_FAILED MESSAGE | TEXT | Message accompanying the operation status FILE_SIZE | NUMBER | Size of the file (in bytes) added to the external table LAST_MODIFIED | TIMESTAMP_LTZ | Timestamp when the file was last updated in the stage