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
    
  • 相关阅读:
    Visual Studio 2019 开发 Python 及
    Delphi 的环境配置
    Delphi 的 TMS 控件安装方法
    网络爬虫-书籍与框架
    建筑行业(项目管理) BI 数据可视化分析案例
    DeepNude(一健脱衣)的算法以及通用图像生成的理论与实践研究
    matlab生成HEX文件-任意信号 大于64K长度
    SDRAM总结
    function [ binary,decimal ] = num2binary16( number )
    任意时钟分频
  • 原文地址:https://www.cnblogs.com/jiangxiaoxian/p/7218758.html
Copyright © 2011-2022 走看看