Skip to main content

SHOW ALTER TABLE MATERIALIZED VIEW

Description​

This command is used to check the execution status of the materialized view creation job submitted via statement CREATE-MATERIALIZED-VIEW

This statement is equivalent to SHOW ALTER TABLE ROLLUP;

Syntax​

SHOW ALTER TABLE MATERIALIZED VIEW
[FROM <database>]
[<where_clause>]
[ORDER BY <order_by_key> [, ...]]
[LIMIT <limit_rows> [ OFFSET <offset_rows>]]

Optional Parameters​

1. FROM <database>

View jobs under the specified database. If not specified, the current database will be used.

2. <where_clause>

You can filter the result columns, and currently, only the following columns are supported for filtering:

  • TableName: Only supports equality filtering.
  • State: Only supports equality filtering.
  • Createtime/FinishTime: Supports =, >=, <=, >, <, !=.

3. ORDER BY

You can sort the result set by any column.

4. LIMIT <limit_rows> [ OFFSET <offset_rows>]

For pagination queries.

Return Value​

ColumnNote
JobIdJob unique ID.
TableNameBase table name.
CreateTimeJob creation time.
FinishTimeJob finish time.
BaseIndexNameBase table name.
RollupIndexNameMaterialized view name.
RollupIdThe unique ID of the materialized view.
TransactionIdSee the description of the State field
StateJob status.
MsgError msg
ProgressProgress of the assignment. Here, progress refers to the "number of completed tablets / total number of tablets". The creation of materialized views is performed on a tablet granularity basis.
TimeoutJob timeout duration, measured in seconds.

State Description:

  • PENDING: The job is in preparation.

  • WAITING_TXN: Before officially starting to generate materialized view data, the system will wait for the ongoing import transactions on the current table to complete. The TransactionId field indicates the ID of the transaction currently being waited for. The job will actually start once all imports with transaction IDs prior to this one have been completed.

  • RUNNING: The job is currently in progress.

  • FINISHED: The job has been successfully completed.

  • CANCELLED: The job failed to run.

Access Control Requirements​

The user who executes this SQL must have at least the following permissions:

PrivilegeObjectNotes
ALTER_PRIVtable

Examples​

  1. View materialized view jobs under the database example_db.

    SHOW ALTER TABLE MATERIALIZED VIEW FROM example_db;