0

I was looking for way to add column in Hive table via Beeline interface only when its not present.

create table employee(ename string , eid string);

alter table employee add columns (eid string);

Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Duplicate column name: eid (state=08S01,code=1)

is there any way to ignore error or not try adding a column if already present ?

Thanks Shashi

Shashi
  • 2,686
  • 7
  • 35
  • 67
  • Possible duplicate of [In Hive, how can I add a column only if that column does not exist?](https://stackoverflow.com/questions/25293019/in-hive-how-can-i-add-a-column-only-if-that-column-does-not-exist) – serge_k Aug 30 '18 at 06:01
  • I found that eariler but it does not seems to be working for beeline. Solution mentioned in question might work for hive CLI. – Shashi Aug 30 '18 at 10:06

0 Answers0