ALTER TABLE ADD PARTITION statement to add a specified partition catalog to a data table. If the partition catalog is compatible with the Hive partitioning rule (partition column name=partition column value), you don't need to specify the data path; otherwise, you need to refer SQL Syntax.ALTER TABLE tabel_demo ADDPARTITION (dt = '2021-01-01');
ALTER TABLE tabel_demo ADDPARTITION (year = '2021', month='01', day='01');
ALTER TABLE tabel_demo ADDPARTITION (year = '2021', month='01', day='01') LOCATION 'cosn://tablea_demo' ;
MSCK REPAIR TABLE statement to scan the data catalog specified during table creation. If there is a new partition catalog, the system will automatically add the partitions to the metadata of the data table. Details can be found in the SQL Syntax.Below is a sample:MSCK REPAIR TABLE table_demo
MSCK REPAIR TABLE only adds partitions to the metadata of the data table but does not delete them. To delete an added partition, run the ALTER TABLE table-name DROP PARTITION statement.Details can be found in the SQL Syntax.MSCK REPAIR TABLE is not recommended if the data volume is large, as the system will scan all the data, which may take a long time, cause the task to time out, and make the partition information of the data table incomplete.ALTER TABLE ADD PARTITION to load a partition.Details can be found in the SQL Syntax.cosn://tablea_a data in table A and the s3://table_a/table_b data in table B are stored in COS and both tables are partitioned by string, then MSCK REPAIR TABLE will add partitions of table B to table A. To avoid this, use separate folder structures, such as cosn://tablea_aand cosn://tablea_b.Feedback