事务表"/>
hive 事务表
目录
- hive outline
- Hive事务表的局限性
- Hive事务表的局限性
hive outline
链接
Hive事务表的局限性
- 默认情况下事务配置为关闭。需要配置参数开启使用
- 仅支持ORC文件格式(STORED AS ORC)
- 表必须是分桶表(Bucketed)才可以使用事务功能
- 表参数transactional必须为true
- 外部表无法创建事务表
Hive事务表的局限性
- 开启事务配置
可以使用set设置当前session生效 也可以配置在hive-site.xml中
set hive.support.concurrency = true; --Hive是否支持并发
set hive.enforce.bucketing = true; -- 是否开启分桶功能 从Hive2.0开始不再需要
set hive.exec.dynamic.partition.mode = nonstrict; --动态分区模式 非严格
set hive.txn.manager = org.apache.hadoop.hive.ql.lockmgr.DbTxnManager; -- 事务管理类
set hive.compactor.initiator.on = true; --是否在Metastore实例上运行启动线程和清理线程
set hive.compactor.worker.threads = 1; --在此metastore实例上运行多少个压缩程序工作线程
- 创建Hive事务表
create table trans_student(id int,name String,age int
)clustered by (id) into 2 buckets stored as orc TBLPROPERTIES('transactional'='true');
更多推荐
hive 事务表
发布评论