Table Functions
This page provides reference information for the table functions in Databend. Table functions return a set of rows (similar to a table) and can be used in the FROM clause of a query.
Data Exploration Functions
Function | Description | Example |
---|---|---|
INFER_SCHEMA | Detects file metadata schema and retrieves column definitions | SELECT * FROM INFER_SCHEMA(LOCATION => '@mystage/data/') |
INSPECT_PARQUET | Inspects the structure of Parquet files | SELECT * FROM INSPECT_PARQUET(LOCATION => '@mystage/data.parquet') |
LIST_STAGE | Lists files in a stage | SELECT * FROM LIST_STAGE(LOCATION => '@mystage/data/') |
RESULT_SCAN | Retrieves the result set of a previous query | SELECT * FROM RESULT_SCAN(LAST_QUERY_ID()) |
Data Generation Functions
Function | Description | Example |
---|---|---|
GENERATE_SERIES | Generates a sequence of values | SELECT * FROM GENERATE_SERIES(1, 10, 2) |
System Management Functions
Function | Description | Example |
---|---|---|
SHOW_GRANTS | Shows granted privileges | SELECT * FROM SHOW_GRANTS() |
SHOW_VARIABLES | Shows system variables | SELECT * FROM SHOW_VARIABLES() |
STREAM_STATUS | Shows stream status information | SELECT * FROM STREAM_STATUS('mystream') |
TASK_HISTROY | Shows task execution history | SELECT * FROM TASK_HISTROY('mytask') |
FUSE_VACUUM_TEMPORARY_TABLE | Cleans up temporary tables | SELECT * FROM FUSE_VACUUM_TEMPORARY_TABLE() |
FUSE_AMEND | Manages data amendments | SELECT * FROM FUSE_AMEND() |
Iceberg Integration Functions
Function | Description | Example |
---|---|---|
ICEBERG_MANIFEST | Shows Iceberg table manifest information | SELECT * FROM ICEBERG_MANIFEST('mytable') |
ICEBERG_SNAPSHOT | Shows Iceberg table snapshot information | SELECT * FROM ICEBERG_SNAPSHOT('mytable') |