How can I duplicate cloudera impala table with impala wrapper or other means?

I see the "test" table in Impala when I show the tables;

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

+3


source to share


2 answers


You can use "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.



+5


source


You can do it with one command: CREATE TABLE new_table AS (SELECT * FROM table);



+6


source







All Articles