copyed = hc.copy_table("source_table_name", "dest_table_name", "source_database_name", "dest_database_name")
Result:
This method returns a String representing the status of copy operation. If the error pops up when copying table, “ValueError” exception will be raised.
Parameter description:
Parameters | Description | Required |
---|---|---|
source_table_name (str) | Source table to be copied | Yes |
dest_table_name (str) | Target table | Yes |
source_database_name (str) | Database where source table is located | No, defaults to "default" database |
dest_database_name (str) | Database where target table is located | No, defaults to "default" database |
remote_info (dict) | Remote info, including IP and port of remote server | Yes |
fields (list) | Fields to be copied | Yes |
fields_projection (list) | Fields to be projected | Yes |
expr (str) | Expression, used to filter data to be copied | Yes |
op_type (str) | Operation type, supports “update” and “upsert” | No, defaults to "upsert" |
wait_for_completion (bool) | Whether to wait until the job is done | No, defaults to True |
timeout (str) | Operation timeout | No, defaults to "2m" |