hive - CTAS with Dynamic Partition -


i want change existing table, contains text format, orc format. able by: (1) creating table in orc format manually having partitions , then, (2) using insert overwrite statement populate table.

i trying use ctas (create table... select...) statement this. there way can include dynamic partitioning ctas statement? so, if text data set has multiple partitions (for example: year , month), can point in ctas statement directly?

the format might this:

create table test_table stored orc partition(year, month) location '/<my_location>' tblproperties ("orc.compress"="snappy") select * <existing_table>; 

any idea please?

note: reason i'm interested ctas statement as: using statement, don't need point out each , every columns name. if create orc based table , populate manually, had indicate columns while creating table. okay; but, not idea if existing table contains lot of columns.

not supported

hive> create table t partitioned (p int) select 1 i; 

failed: semanticexception [error 10068]:
create-table-as-select not support partitioning in target table


Comments