2

I have been trying to make updates to an orc table in hive which is bucketed and also set transactional=true property. The normal update works great but as soon as I alter the table and add a new column e.g. column_added_5, and try to update column_added_5 the statement executes but the column does not get updated.

Any help/directions is appreciated.

Community
  • 1
  • 1
Varun Singh
  • 101
  • 4

2 Answers2

1

I think that one way is:

CREATE TABLE new_table_name AS SELECT column1,column2,column3, ... "default_value" as column_added_5 FROM your_table_name;

DROP TABLE your_table_name;

ALTER TABLE new_table_name RENAME TO your_table_name;
0

Did you try this:

ALTER TABLE table_name ADD COLUMNS ( column_added_5 STRING COMMENT 'Column 5');