hive 事务表

编程入门 行业动态 更新时间:2024-10-25 04:26:36

hive <a href=https://www.elefans.com/category/jswz/34/1770772.html style=事务表"/>

hive 事务表

目录

    • hive outline
    • Hive事务表的局限性
    • Hive事务表的局限性

hive outline

链接

Hive事务表的局限性

  1. 默认情况下事务配置为关闭。需要配置参数开启使用
  2. 仅支持ORC文件格式(STORED AS ORC)
  3. 表必须是分桶表(Bucketed)才可以使用事务功能
  4. 表参数transactional必须为true
  5. 外部表无法创建事务表

Hive事务表的局限性

  1. 开启事务配置

可以使用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实例上运行多少个压缩程序工作线程
  1. 创建Hive事务表
create table trans_student(id int,name String,age int
)clustered by (id) into 2 buckets stored as orc TBLPROPERTIES('transactional'='true');

更多推荐

hive 事务表

本文发布于:2023-07-28 17:48:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1267007.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:事务   hive

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!