hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Keppel <juliankeppel1...@gmail.com>
Subject Re: Alter table statement for "create table like"-tables
Date Tue, 16 Jun 2015 09:42:11 GMT
*Push* Does no one have an idea or hit similar issues?

2015-06-09 15:46 GMT+02:00 Julian Keppel <juliankeppel1991@gmail.com>:

> I use Hive Version 1.1.0 in Cloudera CDH 5.4.0.
>
> I have created an external table:
>
> CREATE EXTERNAL TABLE *tableA*
> ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe'
> STORED AS
>     INPUTFORMAT
> 'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat'
>     OUTPUTFORMAT
> 'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'
> LOCATION 'location'
> TBLPROPERTIES ('avro.schema.url'=schema_location');
>
> Now I wanted to create a managed table with exactly the same columns
> except of one additional column (a generated hash key). The only idea I had
> was to create the table with: CREATE TABLE *tableB* LIKE *tableA*;
>
> And then add the additional column with: ALTER TABLE *tableB* ADD COLUMNS
> (new_column INT);
>
> The statements run without any errors or exceptions (even in the log files
> under /var/log/hive) but the new column doesn't appear.
>
> What am I doing wrong? Or is this not possible? What other ideas do you
> have for my use case?
>
> Thank you in advance for your help!
>

Mime
View raw message