zoukankan      html  css  js  c++  java
  • hive update和delete报错Attempt to do update or delete using transaction manager

    转载自(25条消息) hive update和delete报错Attempt to do update or delete using transaction manager_victorzzzz的专栏-CSDN博客

    默认在hive中没有默认开启支持单条插入(update)、更新以及删除(delete)操作,需要自己配置。而在默认情况下,当用户如果使用update和delete操作时,会出现如下情况:

    hive> update dp set name='beijing' where id=1159;

    FAILED: SemanticException [Error 10294]: Attempt to do update or delete using transaction manager that does not support these operations.

       以下是开启update与delete功能的步骤梳理:
    1、在hive-site.xml文件中,增加如下属性。

        <name>hive.support.concurrency</name>
        <value>true</value>

        <name>hive.enforce.bucketing</name>
        <value>true</value>

        <name>hive.exec.dynamic.partition.mode</name>
        <value>nonstrict</value>

        <name>hive.txn.manager</name>
        <value>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager</value>

        <name>hive.compactor.initiator.on</name>
        <value>true</value>

        <name>hive.compactor.worker.threads</name>
        <value>1</value>

        <name>hive.in.test</name>
        <value>true</value>

    2、重启hive服务;

    3、创建表;
    create table student(
      id int,
      name String,
      sex varchar(2),
      birthday varchar(10),
      major varchar(1)
    )clustered by (id) into 2 buckets stored as orc TBLPROPERTIES('transactional'='true');

    4、测试update,delete语句
    hive> update student set name='beijing' where id=1159;

         修改成功。可以成功执行update与delete。频繁的update和delete操作已经违背了hive的初衷。不到万不得已的情况,还是使用增量添加的方式最好。


    参考:
    开启hive数据表的update delete 
    http://blog.csdn.net/suijiarui/article/details/51174406

    CDH版本hive增加Update、Delete支持
    http://www.cnblogs.com/kekukekro/p/6340974.html

    hive0.14-insert、update、delete操作测试
    http://blog.csdn.net/hi_box/article/details/40820341

  • 相关阅读:
    vue 组件的简单使用01
    vue 绑定 class 和 内联样式(style)
    input select 值得绑定与获取
    computed 计算属性
    v-for 循环 绑定对象 和数组
    过滤器 filter
    v-model 双向数据绑定以及修饰符
    v-on 绑定单个或多个事件
    v-bin:href 绑定链接
    .net core自动发送后台请求写法
  • 原文地址:https://www.cnblogs.com/chaogehahaha/p/15612502.html
Copyright © 2011-2022 走看看