Clone Tables
Paimon supports cloning tables for data migration. Currently, only table files used by the latest snapshot will be cloned.
To clone a table, run the following command to submit a clone job. If the table you clone is not modified at the same time, it is recommended to submit a Flink batch job for better performance. However, if you want to clone the table while writing it at the same time, submit a Flink streaming job for automatic failure recovery.
1. <FLINK_HOME>/bin/flink run \
2. /path/to/paimon-flink-action-0.9.0.jar \
3. clone \
4. --warehouse <source-warehouse-path> \
5. [--database <source-database-name>] \
6. [--table <source-table-name>] \
7. [--catalog_conf <source-paimon-catalog-conf> [--catalog_conf <source-paimon-catalog-conf> ...]] \
8. --target_warehouse <target-warehouse-path> \
9. [--target_database <target-database>] \
10. [--target_table <target-table-name>] \
11. [--target_catalog_conf <target-paimon-catalog-conf> [--target_catalog_conf <target-paimon-catalog-conf> ...]]
12. [--parallelism <parallelism>]
- If
databaseis not specified, all tables in all databases of the specified warehouse will be cloned.- If
tableis not specified, all tables of the specified database will be cloned.
Example: Clone test_db.test_table from source warehouse to target warehouse.
1. <FLINK_HOME>/bin/flink run \
2. /path/to/paimon-flink-action-0.9.0.jar \
3. clone \
4. --warehouse s3:///path/to/warehouse_source \
5. --database test_db \
6. --table test_table \
7. --catalog_conf s3.endpoint=https://****.com \
8. --catalog_conf s3.access-key=***** \
9. --catalog_conf s3.secret-key=***** \
10. --target_warehouse s3:///path/to/warehouse_target \
11. --target_database test_db \
12. --target_table test_table \
13. --target_catalog_conf s3.endpoint=https://****.com \
14. --target_catalog_conf s3.access-key=***** \
15. --target_catalog_conf s3.secret-key=*****
For more usage of the clone action, see
1. <FLINK_HOME>/bin/flink run \
2. /path/to/paimon-flink-action-0.9.0.jar \
3. clone --help
