Created 04-22-2016 10:00 AM
I am trying this
create table emp1 LIKE emp CLUSTERED BY () INTO 4 BUCKETS STORED AS ORC;
Its giving a parse exception :
Created 04-22-2016 04:28 PM
You will need to specify the column you are clustering on, and then achieve it in multiple statements:
CREATE TABLE emp1 LIKE emp; ALTER TABLE emp1 SET FILEFORMAT ORC; ALTER TABLE emp1 CLUSTERED BY (empId) INTO 4 BUCKETS;
Created 04-22-2016 10:39 AM
I don't think you can define other attributes while creating table with "LIKE" option, in theory with "LIKE" it will copy the existing table definition and other attributes. Its better to use alter table after creating it with "LIKE".
EDITED: I think you can change no. of buckets with alter command if you already defined it previously.
Created 04-22-2016 04:28 PM
You will need to specify the column you are clustering on, and then achieve it in multiple statements:
CREATE TABLE emp1 LIKE emp; ALTER TABLE emp1 SET FILEFORMAT ORC; ALTER TABLE emp1 CLUSTERED BY (empId) INTO 4 BUCKETS;