hive count(*) 获得0行数据

来源:互联网 发布:如何计算矩阵一致性 编辑:程序博客网 时间:2024/06/07 14:55

配置hive支持事务操作,在hive-site.xml里添加以配置:

<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>


建表:

create table test(id int) clustered by (id) into 1 buckets stored as orc tblproperties('transactional'='true')

原创粉丝点击