CDH-hive支持insert、update、delete操作

开发要求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 = 1
hive.txn.manager = org.apache.hadoop.hive.ql.lockmgr.DbTxnManager

点击保存更改,分发配置即可

目前只有ORCFileformat支持AcidOutputFormat,不仅如此建表时必须指定参数('transactional' = true)

于是按照网上示例建表:

hive>create table test(id int ,name string )clustered by (id) into 2 buckets stored as orc TBLPROPERTIES('transactional'='true');

insert

hive>insert into table test values (1,'row1'),(2,'row2'),(3,'row3');

delete

hive>delete from test where id = 1;

update

hive>update test set name = 'Raj' where id = 2;

转载于:https://www.cnblogs.com/sellsa/p/9956846.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值