Ok finally got the solution.
Create table if not exists newTable as select oldTable.*, as newColumn
from oldTable
Regards
Venkatesh
On Tuesday, August 11, 2015, venkatesh b venkateshmailingl...@gmail.com
wrote:
Thanks Adam.
As mentioned we have a need that in a single query it should be
Thanks Adam.
As mentioned we have a need that in a single query it should be done, since
ours is an automated query generation and no manual interactions are done.
We need a query like
*Create table if not exists newTable like oldTable, newColumn datatype*
*Without copying data from oldTable.
How about:
create table XXX like YYY;
alter table XXX add columns (new_column int);
From: venkatesh b [mailto:venkateshmailingl...@gmail.com]
Sent: Monday, August 10, 2015 9:28 AM
To: Wangwenli
Cc: user
Subject: Re: How to create new table like existing with an extra column in
single query.
something like this?
create table newTable as select oldTable.*, newCol1,newCol2 from oldTable;
wenli
Regards
From: venkatesh bmailto:venkateshmailingl...@gmail.com
Date: 2015-08-10 20:54
To: usermailto:user@hive.apache.org
Subject: How to create new table like