Reply
Highlighted
New Contributor
Posts: 3
Registered: ‎01-15-2019

Hive Alter Add column

[ Edited ]

I was trying out hive alter by adding new columns to existing table. 

 

I have set up a hive external table on top of HDFS ( CSV serde).. and later added a column .    when run a query , im getting nulls on a new column.. this is as expected.  however, i have ingested data(includes newly added column) now into HDFS  and when i run query again.. im still getting nulls on new column.  

 

can you pls help me why this is occurring ? do i need to run any commands ( analyze stats etc to get a values for newly added column)?

 

Also, when i drop and recreate external table ..its working as expected .    

 

appreciate your help.

 

 

Posts: 38
Topics: 0
Kudos: 11
Solutions: 3
Registered: ‎07-30-2018

Re: Hive Alter Add column

Hi,

 

If there is any changes in the Hive metadata. Please try to run msck repair table <tablename> to get it in sync

 

Reference Link: https://www.cloudera.com/documentation/enterprise/5-13-x/topics/cdh_ig_hive_troubleshooting.html

 

Thanks

Jerry

Announcements
New solutions