Soma Sekhar Kuruva
Soma Sekhar Kuruva

Reputation: 69

How to add column for a view in Hive?

I created view myview with two columns ID and Name. But I want add extra column for this.

I using the query as :

ALTER VIEW myview ADD COLUMNS (AGE int);

But I am getting error as:

required (...)+ loop did not match anything at input 'columns' in add partition statement.

Any help me in this?

Upvotes: 1

Views: 5183

Answers (1)

nobody
nobody

Reputation: 11090

You will have to get the new column from the table from which the view was created.

alter view myview as select col_1 ,col_2 ,Age from your_table

Upvotes: 1

Related Questions