无法从配置单元表中删除行

jchrr9hc  于 2022-10-21  发布在  Hive
关注(0)|答案(1)|浏览(165)

我想在我的Hive表上启动此命令

Delete from customer where id=3;

我犯了这个错误

FAILED: SemanticException: [Error 10294]: Attempt to do update or delete using transactiob manager that does not support these operations.

请问谁能帮我??

fivyi3re

fivyi3re1#

您不能像这样从配置单元中的任何表中删除。表格应该是事务性的。要实现这一点,必须执行几个步骤。
1.设置配置单元参数


# this must be set to true. Hive uses txn manager to do DML.

SET hive.support.concurrency=true;
SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;

# The follwoing are not required if you are using Hive 2.0

SET hive.enforce.bucketing=true;
SET hive.exec.dynamic.partition.mode=nostrict;

# required for standalone hive metastore

SET hive.compactor.initiator.on=true;
SET hive.compactor.worker.threads=1

1.创建orc格式的表,表属性=TRUE,并具有存储桶(配置单元2.0)。
CREATE TABLE示例为-

CREATE TABLE db.emptrans (
 id int,
 name string)
 STORED AS ORC
 TBLPROPERTIES ('transactional'='true');

有关详情,请参阅以下答案-
如何对非事务表进行更新/删除操作

相关问题