Hive在默认情况下是没有办法进行update、delete的,在经过如下操作以后则可以进行以上操作
CREATE TABLE table_name (
id int,
name string
)
CLUSTERED BY (id) INTO 2 BUCKETS STORED AS ORC
TBLPROPERTIES ("transactional"="true");
修改添加hive中的hive-site.xml配置文件
<property>
<name>hive.support.concurrency</name>
<value>true</value>
</property>
<property>
<name>hive.enforce.bucketing</name>
<value>true</value>
</property>
<property>
<name>hive.exec.dynamic.partition.mode</name>
<value>nonstrict</value>
</property>
<property>
<name>hive.txn.manager</name>
<value>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager</value>
</property>
<property>
<name>hive.compactor.initiator.on</name>
<value>true</value>
</property>
如果是CDH,如图所示
如果上述配置文件不生效,则在hive-site.xml 的 Hive Metastore Server 高级配置代码段(安全阀)
与上述相同的配置