The ALTER TABLE
command modifies the definition of a table.
ADD COLUMN
Parameter or clause | Description |
---|---|
ADD [ COLUMN ] | This clause adds a new column to the table. COLUMN is optional. |
column_name | Specify the name of the column you want to add. |
data_type | The data type of the new column. |
DEFAULT | The DEFAULT clause allows you to assign a default value to a column. This default value is used when a new row is inserted, and no explicit value is provided for that column. |
default_expr | default_expr is any constant value or variable-free expression that does not reference other columns in the current table or involve subqueries. The data type of default_expr must match the data type of the column.If default_expr is impure, such as using a function like now(), all historical data will be filled with the result of the expression evaluated at the time the statement was executed. For future insertions, the default expression will be evaluated at the time of each respective insertion. |
DROP COLUMN
Parameter or clause | Description |
---|---|
DROP [ COLUMN ] | This clause drops an existing column from a table. COLUMN is optional. |
IF EXISTS | Do not return an error if the specified column does not exist. A notice is issued instead. |
column_name | Specify the column you want to remove. |
ALTER TABLE t REFRESH SCHEMA
. One exception is you can drop the generated columns even if the schema is defined with a schema registry. Note that dropping these generated columns will trigger a schema refresh.OWNER TO
Parameter or clause | Description |
---|---|
OWNER TO | This clause changes the owner of the table to the specified user. It will cascadingly change all related internal objects as well, and the associated indexes will be changed too. |
new_user | Specify the user you want to assign to the table. |
rw_table_fragments
table.
SET SCHEMA
Parameter or clause | Description |
---|---|
SET SCHEMA | This clause moves the table into another schema. Associated indexes, constraints, and sequences owned by table columns are moved as well. |
schema_name | Specify the schema to which the table will be moved. |
SET PARALLELISM
Parameter or clause | Description |
---|---|
SET PARALLELISM | This clause controls the degree of parallelism for the targeted streaming job. |
parallelism_number | This parameter can be ADAPTIVE or a fixed number, like 1, 2, 3, etc. Altering the parameter to ADAPTIVE will expand the streaming job’s degree of parallelism to encompass all available units, whereas setting it to a fixed number will lock the job’s parallelism at that specific figure. Setting it to 0 is equivalent to ADAPTIVE. After setting the parallelism, the parallelism status of a table can be observed within the internal rw_table_fragments table or the rw_fragmentstable. |
3
by the SET command.
SET PARALLELISM
to change the parallelism and view the change:
SWAP WITH
Parameter | Description |
---|---|
name | The current name of the table to swap. |
target_name | The target name of the table you want to swap with. |
RENAME TO
Parameter or clause | Description |
---|---|
RENAME TO | This clause changes the name of the table. |
new_name | The new name of the table. |
REFRESH SCHEMA
SET SOURCE_RATE_LIMIT
SOURCE_RATE_LIMIT
, refer to How to view runtime parameters.
SET BACKFILL_RATE_LIMIT
BACKFILL_RATE_LIMIT
, refer to How to view runtime parameters.