Support Questions

Find answers, ask questions, and share your expertise

difference between drop and replace in alter table?

Explorer

i am unable to understand the difference between drop and replace in alter table of hive, can any body give the info what it mean exactly. ( even though drop exists why people are using replace to drop the column)

1 REPLY 1

Guru

Drop column actually does not exist at the moment ... it is an open JIRA in Hive https://issues.apache.org/jira/browse/HIVE-15984

If implemented and closed, it would allow you to drop a column in a very direct syntax.

At the moment, to drop a column you have to do the less direct syntax of REPLACE all existing columns with a subset of those columns.

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Add/ReplaceCol...

https://community.hortonworks.com/questions/17884/replace-column-to-hive.html

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.