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!

Reply via email to