title: Hadoop Hive ACID query error
body: <p>I work on an hadoop cluster, hortonworks 2.4 distribution. 
  I want to make ACID operations on a Hive table. Here is my declaration statement:</p>
  
  <pre><code>CREATE TABLE myAcidTable (..)
  CLUSTERED BY(myKey) INTO 1 BUCKETS
  STORED AS ORC TBLPROPERTIES ('transactional'='true','orc.compress'='SNAPPY');
  </code></pre>
  
  <p>I populate this table based on a external Hive table, which have the same structure.</p>
  
  <pre><code>INSERT INTO myAcidTable
  SELECT * FROM MyTmpTable;
  </code></pre>
  
  <p>This operation works well:</p>
  
  <blockquote>
    <p>Loading data to table MyAcidTable<br>
    Table myAcidTable stats:
    [numFiles=1, numRows=4450, totalSize=42001, rawDataSize=0]<br>
    OK</p>
  </blockquote>
  
  <p>I try to query this table via hive shell:</p>
  
  <pre><code>set hive.support.concurrency=true;
  set hive.enforce.bucketing=true;
  set hive.exec.dynamic.partition.mode=nonstrict;
  set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
  set hive.compactor.initiator.on=true;
  set hive.compactor.worker.threads=3;
  
  SELECT * FROM myAcidTable
  WHERE myKey = 12;
  </code></pre>
  
  <p>But i have this error (even if the status seems to be OK):</p>
  
  <blockquote>
    <p>OK<br>
    Failed with exception
    java.io.IOException:java.lang.RuntimeException: serious problem</p>
  </blockquote>
  
  <p>When I look through the logs I find this:</p>
  
  <blockquote>
    <p>org.apache.ambari.view.hive.client.HiveErrorStatusException: H170
    Unable to fetch results. java.io.IOException:
    java.lang.RuntimeException: serious problem</p>
    
    <p>...<br>
    Caused by: java.util.concurrent.ExecutionException:
    java.lang.IllegalArgumentException: delta_0000000_0000000 does not
    start with base_</p>
  </blockquote>
  
  <p>It's weird because when I declare my table without the transactional propoerty, the select statement works well</p>
  
  <pre><code>CREATE TABLE myAcidTable (..)
  CLUSTERED BY(myKey) INTO 1 BUCKETS
  STORED AS ORC TBLPROPERTIES ('orc.compress'='SNAPPY');
  
  SELECT * FROM myAcidTable
  WHERE myKey = 12;
  </code></pre>
  
  <p>Results:</p>
  
  <blockquote>
    <p>OK<br>
    12 ...</p>
  </blockquote>
  
  <p>Do you have any idea where to look? thanks for the help.</p>
  
  <p>The full error:</p>
  
  <blockquote>
    <p>org.apache.hive.service.cli.HiveSQLException: java.io.IOException: 
    java.lang.RuntimeExce</p>
    
    <p>ption: serious problem    at
    org.apache.hive.service.cli.operation.SQLOperation.getNextRowSet(SQLOperation.java:352)
      at
    org.apache.hive.service.cli.operation.OperationManager.getOperationNextRowSet(OperationManager.java:223)
      at
    org.apache.hive.service.cli.session.HiveSessionImpl.fetchResults(HiveSessionImpl.java:716)
      at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)     at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)     at
    org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:78)
      at
    org.apache.hive.service.cli.session.HiveSessionProxy.access$000(HiveSessionProxy.java:36)
      at
    org.apache.hive.service.cli.session.HiveSessionProxy$1.run(HiveSessionProxy.java:63)
      at java.security.AccessController.doPrivileged(Native Method)   at
    javax.security.auth.Subject.doAs(Subject.java:422)    at
    org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
      at
    org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:59)
      at com.sun.proxy.$Proxy22.fetchResults(Unknown Source)  at
    org.apache.hive.service.cli.CLIService.fetchResults(CLIService.java:454)
      at
    org.apache.hive.service.cli.thrift.ThriftCLIService.FetchResults(ThriftCLIService.java:672)
      at
    org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults.getResult(TCLIService.java:1557)
      at
    org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults.getResult(TCLIService.java:1542)
      at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
      at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
      at
    org.apache.hive.service.auth.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:56)
      at
    org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:285)
      at
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745) Caused by:
    java.io.IOException: java.lang.RuntimeException: serious problem  at
    org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:512)
      at
    org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:419)
      at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:143)
      at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1737)    at
    org.apache.hive.service.cli.operation.SQLOperation.getNextRowSet(SQLOperation.java:347)
      ... 24 more Caused by: java.lang.RuntimeException: serious problem
      at
    org.apache.hadoop.hive.ql.io.orc.OrcInputFormat.generateSplitsInfo(OrcInputFormat.java:1115)
      at
    org.apache.hadoop.hive.ql.io.orc.OrcInputFormat.getSplits(OrcInputFormat.java:1142)
      at
    org.apache.hadoop.hive.ql.exec.FetchOperator.getNextSplits(FetchOperator.java:367)
      at
    org.apache.hadoop.hive.ql.exec.FetchOperator.getRecordReader(FetchOperator.java:299)
      at
    org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:450)
      ... 28 more Caused by: java.util.concurrent.ExecutionException:
    java.lang.IllegalArgumentException: delta_0000000_0000000 does not
    start with base_  at
    java.util.concurrent.FutureTask.report(FutureTask.java:122)   at
    java.util.concurrent.FutureTask.get(FutureTask.java:192)  at
    org.apache.hadoop.hive.ql.io.orc.OrcInputFormat.generateSplitsInfo(OrcInputFormat.java:1092)
      ... 32 more Caused by: java.lang.IllegalArgumentException:
    delta_0000000_0000000 does not start with base_   at
    org.apache.hadoop.hive.ql.io.AcidUtils.parseBase(AcidUtils.java:154)
      at
    org.apache.hadoop.hive.ql.io.AcidUtils.parseBaseBucketFilename(AcidUtils.java:182)
      at
    org.apache.hadoop.hive.ql.io.orc.OrcInputFormat$FileGenerator.call(OrcInputFormat.java:725)
      at
    org.apache.hadoop.hive.ql.io.orc.OrcInputFormat$FileGenerator.call(OrcInputFormat.java:690)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)     ... 3
    more</p>
  </blockquote>