I'd like to create a new table based on columns from an existed table, add a new partition col in hive.
And I'd like to achieve the goal in hive sql.
Is there any other way than the following sql or using ETL tools like kettle.
create table if not exists table_name(
col1,
col2,
col3,
……,
coln
)partitioned by dt;
in which col1 to coln are from the already existed older table, and dt, the partition key is newly added.
Because the older table is too big, may has hundreds of columns, listing them would be tiring.
However, the following sql shows syntax error:
create table if not exists table_name like older_table_name partitioned by dt;
So I'd like to know is there any other better way to solve this in hive sql? thank you.