Hive的行级acid事务处理
来源:互联网 发布:人工智能就业 知乎 编辑:程序博客网 时间:2024/06/08 17:13
//事务,hive 0.13.0之后完全支持行级acid事务处理。
//所有事务都是自动提交,并且存储文件只能是orc文件,而且只能在桶表中使用。
1.设置相关属性
SET hive.support.concurrency = true;
SET hive.enforce.bucketing = true;
SET hive.exec.dynamic.partition.mode = nonstrict;
SET hive.txn.manager = org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
SET hive.compactor.initiator.on = true;
SET hive.compactor.worker.threads = 1;
2.显式事务命令:
SHOW TRANSACTIONS;
3.操作语法
INSERT INTO TABLE tablename [PARTITION (partcol1[=val1], partcol2[=val2]...)] VALUES values_row [, values_row …];
UPDATE tablename SET column = value [, column = value…] [WHERE expression]
DELETE FROM tablename [WHERE expression]
4.创建表时,使用桶表,orc文件格式,支持事务的属性
create table tx(id int ,name string , age int)
clustered by (id) into 2 buckets
stored as orc
TBLPROPERTIES('transactional'='true');
5.执行操作
insert into tx(id,name,age) values(1,'tom',2) ;
update tx set name = 'tomas' where id = 1 ;
delete from tx where id =1 ;
//所有事务都是自动提交,并且存储文件只能是orc文件,而且只能在桶表中使用。
1.设置相关属性
SET hive.support.concurrency = true;
SET hive.enforce.bucketing = true;
SET hive.exec.dynamic.partition.mode = nonstrict;
SET hive.txn.manager = org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
SET hive.compactor.initiator.on = true;
SET hive.compactor.worker.threads = 1;
2.显式事务命令:
SHOW TRANSACTIONS;
3.操作语法
INSERT INTO TABLE tablename [PARTITION (partcol1[=val1], partcol2[=val2]...)] VALUES values_row [, values_row …];
UPDATE tablename SET column = value [, column = value…] [WHERE expression]
DELETE FROM tablename [WHERE expression]
4.创建表时,使用桶表,orc文件格式,支持事务的属性
create table tx(id int ,name string , age int)
clustered by (id) into 2 buckets
stored as orc
TBLPROPERTIES('transactional'='true');
5.执行操作
insert into tx(id,name,age) values(1,'tom',2) ;
update tx set name = 'tomas' where id = 1 ;
delete from tx where id =1 ;
阅读全文
0 0
- Hive的行级acid事务处理
- HIVE的ACID特性
- 数据库中事务处理系统的特点--ACID
- 【Java】数据库事务处理的特性:ACID
- 数据库事务处理的四大特性ACID
- 事务处理:进行ACID 测试
- 数据库的事务处理必须满足ACID原则,ACID分别是指什么
- 最新版本的Hive 0.13发布,增加ACID特性
- 最新版本的Hive 0.13发布,增加ACID特性
- Hive ACID 特性 -- 0.13.0
- HIVE 新特性 ACID 初试
- Apache Hive 0.13发布,新增ACID特性
- 数据库ACID的意思
- 事务的ACID属性
- 事务的ACID
- 事物的特性ACID
- 数据库的ACID
- 事务的ACID
- java代码实现文件的复制及更改后缀
- codeforces 464A No to Palindromes! 贪心
- java学习路线
- Codeforces 840B(DFS)
- hdu-6156 CaoHaha's staff
- Hive的行级acid事务处理
- poj 1860
- seekbar设置thumb后在真机出现黑边(不透明区域)
- How to run thing locally
- buffer类的设计
- odoo开发所遇到问题集合
- MySQL大表优化方案
- 用aardio给python写个图形界面
- Java:集合框架(四)Map详解及代码示例