Repository: hive
Updated Branches:
  refs/heads/master e213c4cee -> d2cb97b6f


HIVE-18751: ACID table scan through get_splits UDF doesn't receive 
ValidWriteIdList configuration (Sankar Hariappan, reviewed by Anishek Agarwal)


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

Branch: refs/heads/master
Commit: d2cb97b6fe21e56f4e2d995ffc21e4481ee95fdb
Parents: e213c4c
Author: Sankar Hariappan <sank...@apache.org>
Authored: Mon Mar 12 10:28:40 2018 +0530
Committer: Sankar Hariappan <sank...@apache.org>
Committed: Mon Mar 12 10:28:40 2018 +0530

----------------------------------------------------------------------
 .../hive/ql/udf/generic/GenericUDTFGetSplits.java      | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/d2cb97b6/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java
----------------------------------------------------------------------
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java 
b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java
index 128b66c..ba0d56a 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java
@@ -41,6 +41,8 @@ import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
+import org.apache.hadoop.hive.common.ValidTxnList;
+import org.apache.hadoop.hive.common.ValidTxnWriteIdList;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
 import org.apache.hadoop.hive.llap.FieldDesc;
@@ -307,6 +309,17 @@ public class GenericUDTFGetSplits extends GenericUDTF {
         needsCleanup = false;
       }
 
+      // Pass the ValidTxnList and ValidTxnWriteIdList snapshot configurations 
corresponding to the input query
+      HiveConf driverConf = driver.getConf();
+      String validTxnString = driverConf.get(ValidTxnList.VALID_TXNS_KEY);
+      if (validTxnString != null) {
+        jc.set(ValidTxnList.VALID_TXNS_KEY, validTxnString);
+      }
+      String validWriteIdString = 
driverConf.get(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY);
+      if (validWriteIdString != null) {
+        jc.set(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY, 
validWriteIdString);
+      }
+
       return new PlanFragment(tezWork, schema, jc);
     } finally {
       if (needsCleanup) {

Reply via email to