开发要求hive支持update操作,搞张临时表测试下,报错如下:
配置hive-site.xml
CDH进入hive配置页,选择高级,找到hive-site.xml的HIve客户端高级配置段代码段,点击+号,增加如下配置项:
hive.support.concurrency = true hive.enforce.bucketing = true hive.exec.dynamic.partition.mode = nonstrict hive.compactor.initiator.on = true hive.compactor.worker.threads = hive.txn.manager = org.apache.hadoop.hive.ql.lockmgr.DbTxnManager
点击保存更改,分发配置即可
目前只有ORCFileformat支持AcidOutputFormat,不仅如此建表时必须指定参数('transactional' = true)
于是按照网上示例建表:
hive>create table test( buckets stored as orc TBLPROPERTIES('transactional'='true');
insert
hive>insert into table test values (,,,'row3');
delete
hive>delete from test where ;
update
hive>update test set name = ;