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
    
  • 相关阅读:
    Webpack 2 视频教程 004
    Webpack 2 视频教程 003
    python dic字典排序
    python练习题7.1词频统计
    python文件读写的基础使用(计算总评成绩)
    python常用内置函数使用
    python练习题5.7列表去重(修正)
    python练习题5.2图的字典表示
    python练习题4.15换硬币(修正)
    python练习题4.7统计学生平均成绩与及格人数
  • 原文地址:https://www.cnblogs.com/jiangxiaoxian/p/7218758.html
Copyright © 2011-2022 走看看