This statement is used to create an empty table with the exact same table structure as another table, and can optionally replicate some rollups.
grammar:
- The copied table structure includes Column Definition, Partitions, Table Properties, etc.
- Support for copying external tables such as MySQL
- Support the rollup of copying OLAP Table
Create an empty table with the same table structure as table1 under the test1 library, the table name is table2
CREATE TABLE test1.table2 LIKE test1.table1
Create an empty table with the same table structure as test1.table1 under the test2 library, the table name is table2
Create an empty table with the same table structure as table1 under the test1 library, the table name is table2, and copy all the rollups of table1 at the same time
CREATE TABLE test1.table2 LIKE test1.table1 WITH ROLLUP
Create an empty table with the same table structure as test1.table1 under the test2 library, the table name is table2, and copy the two rollups of r1 and r2 of table1 at the same time
Create an empty table under the test1 library with the same table structure as the MySQL outer table1, the table name is table2