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
    
  • 相关阅读:
    Mysql之存储过程与存储函数
    mysql-bin日志自动清理及手动删除
    mysql下面的binlog
    mysql下的数据备份与恢复
    查询mysql数据库中各个表所占空间大小以及索引大小
    mysql执行sql语句报错this is incompatible with sql_mode=only_full_group_by
    docker WARNING: IPv4 forwarding is disabled. 解决方法
    Linux平台修改环境变量的方式
    PuTsangTo
    (一) 从Angular1到Angular2的杂谈
  • 原文地址:https://www.cnblogs.com/jiangxiaoxian/p/7218758.html
Copyright © 2011-2022 走看看