4
votes

I see options that allow to add new columns in Hive [source]

However, I have EXTERNAL Table which is mapped with HBase with SERDEPROPERTIES, TBLPROPERTIES and STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'.

Is it possible to add/alter columns after External table with HBase is setup?

Do I just SERDEPROPERTIES for the new columns or do we need to re-do the whole table?

1
Have a similar issue. Have you found an answer yet? - user238021
Haven't found a way to do this yet. - Joel

1 Answers

0
votes

When you try to use ALTER TABLE xx ADD COLUMS( xx string); you get the following error.

SemanticException [Error 10134]: ALTER TABLE cannot be used for a non-native table hbase_cdr2

So looking at this, it seems there is no way to update existing table by adding new columns. But you can drop the hive table, create a new table with required columns. Since it is an external table you only update the metadata by doing that.