zoukankan      html  css  js  c++  java
  • hive orc update

    hive-site.xml

    --><configuration>
      <!-- WARNING!!! This file is auto generated for documentation purposes ONLY! -->
      <!-- WARNING!!! Any changes you make to this file will be ignored by Hive.   -->
      <!-- WARNING!!! You must make your changes in hive-site.xml instead.         -->
      <!-- Hive Execution Parameters -->
      <property>
        <name>javax.jdo.option.ConnectionURL</name>
        <value>jdbc:mysql://192.168.1.160:3306/hivedb?createDatabaseIfNotExist=true</value>
      </property>
      <property>
        <name>javax.jdo.option.ConnectionDriverName</name>
        <value>com.mysql.jdbc.Driver</value>
      </property>
    <property>
      <name>javax.jdo.option.ConnectionUserName</name>
      <value>root</value>
    </property>
    
    <property>
      <name>javax.jdo.option.ConnectionPassword</name>
      <value>xxx</value>
    </property>
    <property>
        <name>hive.optimize.sort.dynamic.partition</name>
        <value>false</value>
    </property>
    <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>
    

    不要加此配置不要加此配置不要加此配置 说三遍
    加了会报错 FAILED: RuntimeException Unable to set up transaction database for testing: Can't call rollback when autocommit=true

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

    建表有要求 支持update格式要为orc的表,要指定transactional=true’,并且必须分桶

    create table test(id int,name string) clustered by (name) into 5 buckets stored as orc TBLPROPERTIES('transactional'='true');
    
    insert into table test values (1,'jx');
    
    
    hive (default)> select * from student;
    OK
    1       jx
    
    update student set id=5 where name='jx';
    
    hive (default)> select * from student;
    OK
    5       jx
    
  • 相关阅读:
    IBM Personal Communications 软件:精简绿色版TN3270终端模拟器:经测试可以在 (winxp、win2003、win764)上运行
    virtualbox谨记:续....
    Eclipse连接MySQL数据库
    shell几种字符串加密解密的方法
    表达式语言引擎:Apache Commons JEXL 2.1 发布
    一种表达式语言的解析引擎JEXL简单使用
    Java 实现String语句的执行(Jexl)
    JUnit4
    EL表达式
    Looping through the content of a file in Bash
  • 原文地址:https://www.cnblogs.com/jiangxiaoxian/p/7218758.html
Copyright © 2011-2022 走看看