简体   繁体   中英

Unable to update Hive Transactional table

I am trying to update Hive Transactional table but its giving 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");

Below are the properties I have set for ACID table:

set hive.enforce.bucketing = true;
set hive.support.concurrency = true;
set hive.exec.dynamic.partition.mode = nonstrict;
set hive.txn.manager = org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
set hive.compactor.initiator.on = true;
set hive.compactor.worker.threads = 1;

I am able to delete the data but update is not working. I am running below mentioned Update query:

Update bucketed_poc set col2 = 1 where `col1=877639`; 

In hive transaction tables you cannot update the bucketed column. In your case bucketing is done on col2 column, hence you cannot update the col2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM