Skip to main content

Syntax

alter_option depends on the operation you want to perform on the table. For all supported clauses, see the sections below.

Clauses

ADD COLUMN

  • If your table is defined with a schema registry, you can change the table schema by ALTER TABLE t REFRESH SCHEMA or ALTER TABLE ADD COLUMN.
  • Columns added by this command cannot be used by any existing materialized views or indexes. You must create new materialized views or indexes to reference it.

CONNECTOR WITH

Added in v2.6.0.
Example

DROP CONNECTOR

Removes the connector definition from a table that was created with a connector. The table keeps the same schema and existing data, but ingestion from the upstream source stops. This clause applies to tables created with connector settings, including CDC tables and tables that use a schema registry. It does not apply to plain tables created without a connector, and it does not apply to standalone SOURCE objects. After you drop the connector, the table becomes a plain CREATE TABLE ... and there is no supported way to add a connector back with ALTER TABLE. If you need to resume ingestion, recreate the table with the connector configuration you need.
Example

DROP COLUMN

  • If your table is defined with a schema registry, you can change the table schema by ALTER TABLE t REFRESH SCHEMA or ALTER TABLE DROP COLUMN.
  • You cannot drop columns referenced by materialized views or indexes.
  • To drop a column referenced by a generated column, you must first drop the generated column.

ALTER COLUMN TYPE

Added in v2.5.0.
  • This operation is primarily supported for composite types (struct types). You can add or remove fields from struct types, and struct types can be nested within other composite types.
  • New fields added to a struct type cannot be referenced by existing materialized views or indexes. You must create new materialized views or indexes to reference the new fields.
  • If you remove fields referenced by downstream queries, those fields will return NULL in the query results.

OWNER TO

After setting, you can observe the parallelism status within the internal rw_table_fragments table.

SET SCHEMA

SET PARALLELISM

Here is a more detailed example for you to practice this clause: First, let’s set the parallelism to 3 by the SET command.
Then let’s create a table to view the parallelism we set. As mentioned, the parallelism status of a table can be observed within the rw_fragments table.
Now we can use SET PARALLELISM to change the parallelism and view the change:

SWAP WITH

RENAME TO

REFRESH SCHEMA

This command alters the schema registry of a table created with connectors.
If a downstream fragment references a column that is either missing or has undergone a type change in the updated schema, the command will be declined.

SET SOURCE_RATE_LIMIT

For tables with connector, this statement controls the rate limit of the associated source. For the specific value of SOURCE_RATE_LIMIT, refer to How to view runtime parameters.
Example
Example
Example

SET BACKFILL_PARALLELISM

This statement controls the degree of parallelism used during the backfill phase of a streaming job. It lets you tune resource usage for backfilling independently from the job’s steady-state parallelism.
SET BACKFILL_PARALLELISM is not supported for tables using the Iceberg engine.

SET BACKFILL_RATE_LIMIT

For CDC table created from a CDC source, this statement controls the rate limit of backfilling from the CDC database. For the specific value of BACKFILL_RATE_LIMIT, refer to How to view runtime parameters.
Examples