This is an automated email from the ASF dual-hosted git repository.
jcamacho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new 11c79af HIVE-22003: Shared work optimizer may leave semijoin branches
in plan that are not used (Jesus Camacho Rodriguez, reviewed by Vineet Garg)
(addendum)
11c79af is described below
commit 11c79af48b2a0a901f541436b2d4669d635ff750
Author: Jesus Camacho Rodriguez <[email protected]>
AuthorDate: Mon Jul 22 21:46:54 2019 -0700
HIVE-22003: Shared work optimizer may leave semijoin branches in plan that
are not used (Jesus Camacho Rodriguez, reviewed by Vineet Garg) (addendum)
---
.../org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git
a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java
index 4c27c5b..b9c1094 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java
@@ -510,6 +510,15 @@ public class SharedWorkOptimizer extends Transform {
return mergedExecuted;
}
+ /**
+ * When we call this method, we have already verified that the SJ
expressions targeting
+ * two TS operators are the same.
+ * Since we already had a method to push the filter expressions on top of
the discardable
+ * TS (pushFilterToTopOfTableScan), here we remove the old SJ expressions
from the
+ * discardable TS (and follow-up Filters if present) and we add the SJ
expressions
+ * from the retainable TS. That way the SJ expressions will be pushed on top
of the
+ * discardable TS by pushFilterToTopOfTableScan.
+ */
private static void replaceSemijoinExpressions(TableScanOperator tsOp,
List<ExprNodeDesc> semijoinExprNodes) {
ExprNodeDesc constNode = new ExprNodeConstantDesc(
TypeInfoFactory.booleanTypeInfo, Boolean.TRUE);