2

I am using Apache Hive latest available version viz. apache-hive-1.2.1. It is said that Apache Hive now supports Update, Delete statements.

But I am not able to delete rows. Behavior is as follows.

hive> delete employee;
Usage: delete [FILE|JAR|ARCHIVE] <value> [<value>]*
Query returned non-zero code: 1, cause: null

hive> delete * from employee;
Usage: delete [FILE|JAR|ARCHIVE] <value> [<value>]*
Query returned non-zero code: 1, cause: null

hive> delete from employee where 1=2;
FAILED: SemanticException [Error 10294]: Attempt to do update or delete     using transaction manager that does not support these operations.

EDIT : Discussion at How to delete and update a record in Hive mentions that new version of Hive supports these operations. But my experience here is different. So this question is specific to new version and how to enable these operations.

Community
  • 1
  • 1
Kaushik Lele
  • 6,439
  • 13
  • 50
  • 76
  • possible duplicate of [How to delete and update a record in Hive](http://stackoverflow.com/questions/17810537/how-to-delete-and-update-a-record-in-hive) – Avinash Reddy Aug 25 '15 at 13:12
  • @Avinash I had referred that thread. Accepted answer refers to older version where DELETE/UPDATE were not available. Other answer which mentions new version. My question is specific to new version and if there are any additional settings needed. – Kaushik Lele Aug 25 '15 at 13:21
  • Pl. check this https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-Delete Deletes can only be performed on tables that support ACID. Check if the empolyees table satisfies this criteria – Avinash Reddy Aug 25 '15 at 13:33
  • Your table properties should include transactional=true. i.e TBLPROPERTIES ("transactional"="true") – Avinash Reddy Aug 25 '15 at 13:37

0 Answers0