我正在尝试创建一个允许更新的表。我已经看了几个关于如何配置它的文档。我们使用的是HDP 2.2.4.5和Hive 0.14。
以下是我设置的配置。我在hive的命令客户端中运行它们。
hive> set hive.support.concurrency;
hive.support.concurrency=true
hive> set hive.enforce.bucketing;
hive.enforce.bucketing=true
hive> set hive.exec.dynamic.partition.mode;
hive.exec.dynamic.partition.mode=nonstrict
hive> set hive.txn.manager;
hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager
hive> set hive.compactor.initiator.on;
hive.compactor.initiator.on=true
hive> set hive.compactor.worker.threads;
hive.compactor.worker.threads=1
这是我的表的创建语句:
CREATE TABLE bt_xda_zgrp_sch_stg_update_3(
`xda_zgrp_id` int,
`day_of_wk_ind` int,
`max_dlvry_qty` int,
`last_upd_user_id` string,
`last_upd_ts` timestamp)
clustered by (xda_zgrp_id) into 9 buckets
stored as orc TBLPROPERTIES ('transactional'='true');
如果您发现任何问题或有任何建议,请与我们联系。
提前致谢,
克雷格
答案 0 :(得分:0)
从“表格创建”命令中,清楚表明您正在创建一个分段表。
" Hive Update"无法在Bucketed表格上执行。
中找到Hive Update的限制希望这会有所帮助:)
答案 1 :(得分:0)
问题是我在设置Txn.manager之前运行了一个命令(比如“use db_name”)。这导致txn.manager被设置为初始化,并且无法重置直到打开新会话。如果我在做任何其他事情之前设置此属性它将起作用。请在此处找到更详细的答案:
http://hortonworks.com/community/forums/topic/help-with-hive-update/