hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wangwenli <wangwe...@huawei.com>
Subject Re: How to create new table like existing with an extra column in single query.
Date Mon, 10 Aug 2015 13:08:22 GMT
something like this?
create table newTable as select oldTable.*, newCol1,newCol2 from oldTable;

________________________________
wenli
Regards

From: venkatesh b<mailto:venkateshmailinglist@gmail.com>
Date: 2015-08-10 20:54
To: user<mailto:user@hive.apache.org>
Subject: How to create new table like existing with an extra column in single query.
Hello,

In hive we got a need that we need to create a new table like the old table with an extra
column at run time. This must be done in a single query. No second query with alter table
statement.

Query like:

Create table new_table like old_table , new_column datatype;

Please help me out, searched in many forums but not found the solution.
Please inform me if any other information is needed.

Thanks & Regards
Venkatesh
Mime
View raw message