Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to duplicate cloudera impala table with impala-shell or other means?

I see a table "test" in Impala when I do show tables;

I want to make a copy of the "test" table so that it is an exact duplicate, but named "test_copy". Is there a impala query I can execute to do this? If not, how can I do this?

like image 704
Rolando Avatar asked Oct 29 '14 17:10

Rolando


1 Answers

You can use the "CREATE TABLE test_copy LIKE test" to create a table with the same metadata. Then you can use "INSERT INTO TABLE test_copy SELECT * FROM test" to copy the data.

like image 95
Matt Avatar answered Jan 04 '23 00:01

Matt