Database Metadata Views

In this section, we will introduce various database metadata views to help you better understand and query your data. These views provide detailed information about databases, tables, columns, views, users, roles, and job history. Through these views, you can easily manage and monitor your data.

SCHEMAS View

The SCHEMAS view provides detailed information about the database, including the WORKSPACE name, SCHEMA name, creator, type, etc.

Field Details

COLUMN NAMEDATA TYPEDescription
CATALOG_NAMESTRINGThe name of the current WORKSPACE
SCHEMA_NAMESTRINGThe name of the database
SCHEMA_CREATORSTRINGThe account name of the database owner
TYPESTRINGEnum values: EXTERNAL (external), INTERNAL (internal)
COMMENTSTRINGComment information when creating the database
CREATE_TIMETIMESTAMPDatabase creation time
LAST_MODIFY_TIMETIMESTAMPDatabase modification time
PROPERTIESMAPPROPERTIES specified at creation, reserved field

TABLES View

The TABLES view shows detailed information about each table under the current WORKSPACE.

Field Details

COLUMN NAMEDATA TYPEDescription
TABLE_CATALOGSTRINGThe name of the current WORKSPACE
TABLE_SCHEMASTRINGThe SCHEMA to which the current TABLE belongs
TABLE_NAMESTRINGThe name of the table
TABLE_TYPESTRINGEnum values: EXTERNAL (external table), VIEW (view), MATERIALIZED VIEW (materialized view), BASE TABLE (standard table), SNAPSHOT (snapshot table)
ROW_COUNTBIGINTNumber of rows in the table (NULL for VIEW, corresponding number for MATERIALIZED VIEW)
BYTESBIGINTSize of the table (NULL for VIEW, corresponding size for MATERIALIZED VIEW)
CREATE_TIMETIMESTAMPTable creation time
LAST_MODIFY_TIMETIMESTAMPTable modification time
TABLE_CREATORSTRINGThe account name of the table owner
IS_PARTITIONEDBOOLEANWhether it is a partitioned table (NULL for VIEW)
IS_CLUSTEREDBOOLEANWhether it is a clustered table (NULL for VIEW)
COMMENTSTRINGTable comment information
DATA_LIFECYCLEBIGINTLifecycle (in days)
PROPERTIESMAPPROPERTIES specified at creation, reserved field

COLUMNS View

The COLUMNS view shows detailed information about each field in the table.

Field Details

COLUMN NAMEDATA TYPEDescription
TABLE_CATALOGSTRINGThe name of the current WORKSPACE
TABLE_SCHEMASTRINGThe SCHEMA to which the current TABLE belongs
TABLE_NAMESTRINGThe name of the table
COLUMN_NAMESTRINGThe name of the field
COLUMN_DEFAULTSTRINGDefault value of the field
IS_NULLABLEBOOLEANWhether it can be NULL
DATA_TYPESTRINGField type
CREATE_TIMETIMESTAMP_LTZTable creation time
IS_CLUSTERING_COLUMNBOOLEANWhether it is a CLUSTER field
IS_PRIMARY_KEYBOOLEANWhether it is a primary key
COMMENTSTRINGField comment information

VIEWS View

The VIEWS view shows all views and their detailed information under the current WORKSPACE.

Field Details

COLUMN NAMEDATA TYPEDESCRIPTION
TABLE_CATALOGSTRINGName of the current WORKSPACE
TABLE_SCHEMASTRINGSCHEMA to which the current VIEW belongs
TABLE_NAMESTRINGName of the view
TABLE_CREATORSTRINGAccount name of the view owner
VIEW_DEFINITIONSTRINGStatement to create the view
CREATE_TIMETIMESTAMPView creation time
LAST_MODIFY_TIMETIMESTAMPView modification time
COMMENTSTRINGView comment information

USERS View

Each user is displayed in a row, containing all users of the current WORKSPACE

COLUMN NAMEDATA TYPEDESCRIPTION
WORKSPACE_NAMESTRINGName of the current space
USER_NAMESTRINGUser name
ROLE_NAMESTRINGRoles owned by the current user, multiple roles separated by commas
CREATE_TIMETIMESTAMPUser join time
EMAILSTRINGUser email
TELEPHONESTRINGUser phone number
COMMENTSTRINGDescription of user information
PROPERTIESMAPPROPERTIES specified at creation, reserved field

ROLES View

COLUMN NAMEDATA TYPEDESCRIPTION
WORKSPACE_NAMESTRINGName of the current space
ROLE_NAMESTRINGAll roles in the space
USER_NAMESSTRINGUser names granted this role, multiple users separated by commas
CREATE_TIMETIMESTAMPView creation time
COMMENTSTRINGDescription of role information
PROPERTIESMAPPROPERTIES specified at creation, reserved field

JOB_HISTORY View

COLUMN NAMEDATA TYPEDESCRIPTION
WORKSPACE_NAMESTRINGSpace where the JOB is run
JOB_IDSTRINGJob ID
JOB_NAMESTRINGJob name
JOB_CREATORSTRINGUser running the job
STATUSSTRINGSCHEDULE, PROCESS, SUCCEEDED, FAILED, CANCELLED
CRUDECIMALComputing resources consumed by the task
ERROR_MESSAGESTRINGThis information is available if an error occurs
JOB_TYPESTRINGJob type COPY SQL DATALAKE (file operation commands)
JOB_TEXTSTRINGStatement executing the JOB
QUERY_TAGSTRINGUser-set TAG for identifying the QUERY
START_TIMETIMESTAMPJOB start time
END_TIMETIMESTAMPJOB end time
EXECUTION_TIMEDOUBLEExecution time in seconds, accurate to milliseconds
INPUT_BYTESBIGINTActual scanned data volume.
OUTPUT_BYTESBIGINTOutput bytes.
INPUT_OBJECTSSTRINGInput table names
OUTPUT_OBJECTSSTRINGOutput table names
CLIENT_INFOSTRINGClient information, from JDBC, client, web page
VIRTUAL_CLUSTERSTRINGComputing resources used
ROW_PRODUCEDBIGINTTotal records processed, input data
ROW_INSERTEDBIGINTShould have a value if it is an insert action
ROW_UPDATEDBIGINTShould have a value if it is an update action
ROW_DELETEDBIGINTShould have a value if it is a delete action
JOB_CONFIGSTRINGParameter information set when submitting the job
CACHE_HITBIGINTData read from cache
JOB_PRIORITYSTRINGJob priority
INPUT_TABLESSTRINGInput table names
OUTPUT_TABLESSTRINGOutput table name

Materialized View Refresh History

COLUMN_NAMEDATA_TYPEDESCRIPTION
WORKSPACE_NAMESTRINGProject workspace name
SCHEMA_NAMESTRINGSCHEMA name
MATERIALIZED_VIEW_NAMESTRINGMaterialized view name
CRUDECIMALCost for refreshing the materialized view
VIRTUAL_CLUSTER_NAMESTRINGMaterialized view name, this information is available for automatic refresh
STATUSSTRINGPENDING\RUNNING\FINISHED\FAILED
SCHEDULED_START_TIMETIMESTAMP_LTZScheduled refresh time
START_TIMETIMESTAMP_LTZMaterialized view start time
END_TIMETIMESTAMP_LTZMaterialized view end time
ERROR_CODESTRING
ERROR_MESSAGESTRINGRefresh failure information, if failed it will be here

AUTOMV_REFRESH_HISTORY Refresh View

COLUMN_NAMEDATA_TYPEDESCRIPTION
WORKSPACE_NAMESTRINGProject workspace name SYS
SCHEMA_NAMESTRINGSCHEMA name, SCHEMA where AUTOMV is located
MATERIALIZED_VIEW_NAMESTRINGMaterialized view name
CRUDECIMALCost for refreshing the materialized view
STATUSSTRINGPROCESS: Refreshing. SUCCEEDED: Refresh completed successfully. FAILED: Refresh failed during execution. CANCELLED: Refresh was cancelled before execution.
MV_PROCESS_TYPESTRINGBUILD: Build MV. REFRESH: Refresh
START_TIMETIMESTAMP_LTZStart time of the materialized view
END_TIMETIMESTAMP_LTZEnd time of the materialized view
BUILD_FROM_WORKSPACESTRINGSource workspace for building MV
JOB_IDSRINGJob ID for building MV
ERROR_MESSAGESTRINGError message if the refresh fails

VOLUMES View

column_namedata_typedescription
VOLUME_CATALOGSTRINGName of the associated Workspace
VOLUME_SCHEMASTRINGName of the associated Schema
VOLUME_NAMESTRINGName of the Volume
VOLUME_URLSTRINGURL bound to the Volume
VOLUME_REGIONSTRINGRegion to which the Volume belongs
VOLUME_TYPESTRINGType of Volume (internal means no need to specify a third-party cloud provider address when creating the volume, or external)
VOLUME_CREATORSTRINGOwner of the Volume
CONNECTION_NAMESTRINGName of the referenced connection
COMMENTSTRINGComment
PROPERTIESmap<string,string>
CREATE_TIMETIMESTAMPCreation time
LAST_MODIFY_TIMETIMESTAMPModification time

CONNECTIONS View

column_namedata typedescription
WORKSPACE_NAMESTRINGThe workspace where the object is located
CONNECTION_NAMESTRINGConnection object name
CONNECTION_KINDSTRINGEnum value supporting connection types, STORAGE CONNECTION, API CONNECTION
TYPESTRINGSpecifies the type of data source connection. storage connection supports FILE_SYSTEM, api connection supports CLOUD_FUNCTION
PROVIDERSTRINGWhen TYPE is FILE_SYSTEM, it is OSS / COS. When TYPE is CLOUD_FUNCTION, it is aliyun / tencent
REGIONSTRINGThe region of the connection, such as ap-shanghai / cn-beijing
SOURCE_CREATORSTRINGCreator
CREATE_TIMETIMESTAMPCreation time
LAST_MODIFY_TIMETIMESTAMPLast modification time
COMMENTSTRINGComment information
PROPERTIESmap<string,string>