Updated on 2024-08-30 GMT+08:00

Spark Table Data Maintenance Specifications

Do not run the Alter command to modify the key attributes of a table: type/primaryKey/preCombineField/hoodie.index.type.

Run the following statement to modify the key attributes of the table:

alter table dsrTable set tblproperties('type'='xx');
alter table dsrTable set tblproperties('primaryKey'='xx');
alter table dsrTable set tblproperties('preCombineField'='xx');
alter table dsrTable set tblproperties('hoodie.index.type'='xx');

Engines such as Hive and Presto can directly modify table attributes. However, such modification will cause duplicate data in the entire Hudi table or even data damage. Therefore, do not modify the preceding attributes.