欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

Attempt to do update or delete on table db1.table1 that is not transactional解决

发布时间:2023/12/31 编程问答 50 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Attempt to do update or delete on table db1.table1 that is not transactional解决 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

在datagrip尝试对hive中的表格进行删除,碰到了这么个问题

Attempt to do update or delete on table db1.table1 that is not transactional

官方依据是[1],也就是说支持事务操作需要设置一大堆东西.
根据[2][3]配置完后,
记得重启元数据服务,
重启hiveserver2
重启yarn timelineserver
重启时都新开终端。

上述配置完后,应该是可以了。
但是也只是可能而已。

如果hive中进行delete的时候卡住,注意检查yarn界面是不是资源占满了。

测试:
①use db1;
②create table t1(id int, name string)
clustered by (id) into 8 buckets
stored as orc TBLPROPERTIES (‘transactional’=‘true’);

insert into t1 values (1,‘aaa’);
insert into t1 values (2,‘bbb’);

update t1 set name=‘ccc’ where id=1;
delete from t1 where id=2;

完整Hive配置:
https://gitee.com/appleyuchi/cluster_configuration/blob/master/spark3.0.0-hadoop3.2.1离线多机集群配置-完成/apache-hive-3.0.0-bin-完成/conf/hive-site.xml

Reference:
[1]Hive Transactions
[2]hive0.14-insert、update、delete操作测试
[3]CDH5.4.10 在Hive上执行Update,Delete操作报错Attempt to do update or

创作挑战赛新人创作奖励来咯,坚持创作打卡瓜分现金大奖

总结

以上是生活随笔为你收集整理的Attempt to do update or delete on table db1.table1 that is not transactional解决的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。