zoukankan      html  css  js  c++  java
  • hive事物开启

    1、hive的DML操作
    	在执行update、delete操作的时候需要开启事务的支持
    2、hive事务的开启需要以下的依赖的条件
    	只支持ORCFile文件格式
    	默认关闭,需要手动开启
    	表必须支持分桶
    	0.14开始支持insert,delete,update操作
    	必须加入配置
    3、需要添加的配置	
    	<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>
    	<property>
    		<name>hive.compactor.worker.threads</name>
    		<value>1</value>
    	</property>
    4、创建表验证
    	create table test_trancaction (user_id Int,name String) clustered by (user_id) into 3 buckets stored as orc TBLPROPERTIES ('transactional'='true');
    	create table test_insert_test(id int,name string) row format delimited fields TERMINATED BY ',';
    	insert into test_trancaction select * from test_insert_test;
    	update test_trancaction set name='jerrick_up' where id=1;
    5、数据文件
    	1,jerrick
    	2,tom
    	3,jerry
    	4,lily
    	5,hanmei
    	6,limlei
    	7,lucky
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    

      

  • 相关阅读:
    寒假作业 疫情统计(2/2)
    2020春 软工实践寒假作业(1/2)
    个人作业——软件工程实践总结&个人技术博客
    使用Angular HttpClient与后端通信
    个人作业——软件评测
    结对第二次作业——某次疫情统计可视化的实现
    寒假作业(2/2)
    NSArray
    NSDate和NSDateFormatter
    NSNumber和NSString
  • 原文地址:https://www.cnblogs.com/huiandong/p/9441490.html
Copyright © 2011-2022 走看看