hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject hive git commit: HIVE-16850 : Only open a new transaction when there's no currently opened transaction (Wei Zheng)
Date Wed, 07 Jun 2017 22:28:34 GMT
Repository: hive
Updated Branches:
  refs/heads/hive-14535 78f28c885 -> fae25566b


HIVE-16850 : Only open a new transaction when there's no currently opened transaction (Wei
Zheng)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/fae25566
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/fae25566
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/fae25566

Branch: refs/heads/hive-14535
Commit: fae25566beae8ae43e694b3a312fb47dbaf4186b
Parents: 78f28c8
Author: Wei Zheng <weiz@apache.org>
Authored: Wed Jun 7 15:28:19 2017 -0700
Committer: Wei Zheng <weiz@apache.org>
Committed: Wed Jun 7 15:28:19 2017 -0700

----------------------------------------------------------------------
 ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java      | 8 ++++++--
 ql/src/test/results/clientpositive/llap/mm_conversions.q.out | 2 --
 ql/src/test/results/clientpositive/mm_conversions.q.out      | 2 --
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/fae25566/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
index e9b8f6e..82a9fad 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
@@ -4147,8 +4147,12 @@ public class DDLTask extends Task<DDLWork> implements Serializable
{
     long mmWriteId = 0;
     try {
       HiveTxnManager txnManager = SessionState.get().getTxnMgr();
-      mmWriteId = txnManager.openTxn(new Context(conf), conf.getUser());
-      txnManager.commitTxn();
+      if (txnManager.isTxnOpen()) {
+        mmWriteId = txnManager.getCurrentTxnId();
+      } else {
+        mmWriteId = txnManager.openTxn(new Context(conf), conf.getUser());
+        txnManager.commitTxn();
+      }
     } catch (Exception e) {
       String errorMessage = "FAILED: Error in acquiring locks: " + e.getMessage();
       console.printError(errorMessage, "\n"

http://git-wip-us.apache.org/repos/asf/hive/blob/fae25566/ql/src/test/results/clientpositive/llap/mm_conversions.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/mm_conversions.q.out b/ql/src/test/results/clientpositive/llap/mm_conversions.q.out
index 1610672..d95a70e 100644
--- a/ql/src/test/results/clientpositive/llap/mm_conversions.q.out
+++ b/ql/src/test/results/clientpositive/llap/mm_conversions.q.out
@@ -315,7 +315,6 @@ PREHOOK: query: alter table simple_to_mm set tblproperties("transactional"="true
 PREHOOK: type: ALTERTABLE_PROPERTIES
 PREHOOK: Input: default@simple_to_mm
 PREHOOK: Output: default@simple_to_mm
-FAILED: Error in acquiring locks: Transaction already opened. txnid:30
 POSTHOOK: query: alter table simple_to_mm set tblproperties("transactional"="true", "transactional_properties"="insert_only")
 POSTHOOK: type: ALTERTABLE_PROPERTIES
 POSTHOOK: Input: default@simple_to_mm
@@ -758,7 +757,6 @@ PREHOOK: query: alter table part_to_mm set tblproperties("transactional"="true",
 PREHOOK: type: ALTERTABLE_PROPERTIES
 PREHOOK: Input: default@part_to_mm
 PREHOOK: Output: default@part_to_mm
-FAILED: Error in acquiring locks: Transaction already opened. txnid:63
 POSTHOOK: query: alter table part_to_mm set tblproperties("transactional"="true", "transactional_properties"="insert_only")
 POSTHOOK: type: ALTERTABLE_PROPERTIES
 POSTHOOK: Input: default@part_to_mm

http://git-wip-us.apache.org/repos/asf/hive/blob/fae25566/ql/src/test/results/clientpositive/mm_conversions.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/mm_conversions.q.out b/ql/src/test/results/clientpositive/mm_conversions.q.out
index 1610672..d95a70e 100644
--- a/ql/src/test/results/clientpositive/mm_conversions.q.out
+++ b/ql/src/test/results/clientpositive/mm_conversions.q.out
@@ -315,7 +315,6 @@ PREHOOK: query: alter table simple_to_mm set tblproperties("transactional"="true
 PREHOOK: type: ALTERTABLE_PROPERTIES
 PREHOOK: Input: default@simple_to_mm
 PREHOOK: Output: default@simple_to_mm
-FAILED: Error in acquiring locks: Transaction already opened. txnid:30
 POSTHOOK: query: alter table simple_to_mm set tblproperties("transactional"="true", "transactional_properties"="insert_only")
 POSTHOOK: type: ALTERTABLE_PROPERTIES
 POSTHOOK: Input: default@simple_to_mm
@@ -758,7 +757,6 @@ PREHOOK: query: alter table part_to_mm set tblproperties("transactional"="true",
 PREHOOK: type: ALTERTABLE_PROPERTIES
 PREHOOK: Input: default@part_to_mm
 PREHOOK: Output: default@part_to_mm
-FAILED: Error in acquiring locks: Transaction already opened. txnid:63
 POSTHOOK: query: alter table part_to_mm set tblproperties("transactional"="true", "transactional_properties"="insert_only")
 POSTHOOK: type: ALTERTABLE_PROPERTIES
 POSTHOOK: Input: default@part_to_mm


Mime
View raw message