Updated on 2026-06-27 GMT+08:00

CHANGE_TABLE

Notes and Constraints

This section applies only to MRS 3.2.0-LTS or later.

Function

The CHANGE_TABLE command is used to modify a Hudi table's type or index. This command works by rewriting the table, as Hudi does not support the direct modification of key table parameters.

Syntax

call change_table(table => '[table_name]', hoodie.index.type => '[index_type]', hoodie.datasource.write.table.type => '[table_type]');

Parameter Description

Table 1 Parameters

Parameter

Description

table_name

Name of the table to be modified

table_type

Type of the table to be modified

index_type

Type of the index to be modified

Precautions

If the index type to be modified has other configuration parameters, the parameters must be transferred to the SQL statement in the key =>'value' format.

For example, to change the index type to bucket, run the following command:

call change_table(table => 'hudi_table1', hoodie.index.type => 'BUCKET', hoodie.bucket.index.num.buckets => '3');

Example

call change_table(table => 'hudi_table1', hoodie.index.type => 'SIMPLE', hoodie.datasource.write.table.type => 'MERGE_ON_READ');

Response

After the execution is complete, you can run the desc formatted table command to view the table properties.