Support Questions
Find answers, ask questions, and share your expertise

Unable to update an ACID table in Hive

Highlighted

Unable to update an ACID table in Hive

I am trying to update an ACID table in Hive but its throwing below error:

FAILED: SemanticException [Error 10290]: Encountered parse error while parsing rewritten merge/update or delete query.

Below is my Table DDL:

CREATE TABLE bucketed_poc(
Col1 Int,
Col2 Int
)
CLUSTERED BY (Col2) INTO 10 BUCKETS
STORED AS ORC TBLPROPERTIES("transactional"="true","orc.compress"="ZLIB"); 

Update Statement:

 update bucketed_poc set Col1 = 1 where Col2 = 246313154;
1 REPLY 1
Highlighted

Re: Unable to update an ACID table in Hive

@Muhammad Umar

Let me know the version of HDP and Hive. Also, check if the Hive transactions properties are set properly.

I verified the same table creation and update which worked fine for me.

hive> CREATE TABLE bucketed_poc(
    > Col1 Int,
    > Col2 Int
    > )
    > CLUSTERED BY (Col2) INTO 10 BUCKETS
    > STORED AS ORC TBLPROPERTIES("transactional"="true","orc.compress"="ZLIB");
OK
Time taken: 7.927 seconds
hive> update bucketed_poc set Col1 = 2 where Col2 = 2;
Query ID = hive_20170720165849_37ec7e0d-055e-479e-a04d-d36bf7c652c0
Total jobs = 1
Launching Job 1 out of 1
--------------------------------------------------------------------------------
Loading data to table default.bucketed_poc
Table default.bucketed_poc stats: [numFiles=2, numRows=0, totalSize=1190, rawDataSize=0]
hive> select * from default.bucketed_poc;
OK
2	2
Time taken: 0.263 seconds, Fetched: 1 row(s)