You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by om...@apache.org on 2014/04/09 21:39:56 UTC

svn commit: r1586097 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java

Author: omalley
Date: Wed Apr  9 19:39:56 2014
New Revision: 1586097

URL: http://svn.apache.org/r1586097
Log:
HIVE-6850. Fix fetch operator to use correct valid transaction list. (omalley)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java?rev=1586097&r1=1586096&r2=1586097&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java Wed Apr  9 19:39:56 2014
@@ -119,10 +119,6 @@ public class Driver implements CommandPr
         throw new SemanticException(e.getMessage(), e);
       }
     }
-    // the reason that we set the txn manager for the cxt here is because each
-    // query has its own ctx object. The txn mgr is shared across the
-    // same instance of Driver, which can run multiple queries.
-    ctx.setHiveTxnManager(txnMgr);
   }
 
   private boolean checkConcurrency() throws SemanticException {
@@ -814,7 +810,7 @@ public class Driver implements CommandPr
   private int recordValidTxns() {
     try {
       ValidTxnList txns = txnMgr.getValidTxns();
-      ctx.getConf().set(ValidTxnList.VALID_TXNS_KEY, txns.toString());
+      conf.set(ValidTxnList.VALID_TXNS_KEY, txns.toString());
       return 0;
     } catch (LockException e) {
       errorMessage = "FAILED: Error in determing valid transactions: " + e.getMessage();
@@ -993,13 +989,6 @@ public class Driver implements CommandPr
     perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.TIME_TO_SUBMIT);
 
     int ret;
-    if (!alreadyCompiled) {
-      ret = compileInternal(command);
-      if (ret != 0) {
-        return new CommandProcessorResponse(ret, errorMessage, SQLState);
-      }
-    }
-
     boolean requireLock = false;
     boolean ckLock = false;
     try {
@@ -1014,6 +1003,20 @@ public class Driver implements CommandPr
       ret = 10;
       return new CommandProcessorResponse(ret, errorMessage, SQLState);
     }
+    ret = recordValidTxns();
+    if (ret != 0) return new CommandProcessorResponse(ret, errorMessage, SQLState);
+
+    if (!alreadyCompiled) {
+      ret = compileInternal(command);
+      if (ret != 0) {
+        return new CommandProcessorResponse(ret, errorMessage, SQLState);
+      }
+    }
+
+    // the reason that we set the txn manager for the cxt here is because each
+    // query has its own ctx object. The txn mgr is shared across the
+    // same instance of Driver, which can run multiple queries.
+    ctx.setHiveTxnManager(txnMgr);
 
     if (ckLock) {
       boolean lockOnlyMapred = HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_LOCK_MAPRED_ONLY);
@@ -1040,9 +1043,6 @@ public class Driver implements CommandPr
       }
     }
 
-    ret = recordValidTxns();
-    if (ret != 0) return new CommandProcessorResponse(ret, errorMessage, SQLState);
-
     if (requireLock) {
       ret = acquireReadWriteLocks();
       if (ret != 0) {