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 be1b39e  HIVE-21568: HiveRelOptUtil.isRowFilteringPlan should skip 
Project (Jesus Camacho Rodriguez, reviewed by Vineet Garg)
be1b39e is described below

commit be1b39e5dfde0d06162b44b411c23217b1d7dabb
Author: Jesus Camacho Rodriguez <[email protected]>
AuthorDate: Wed Apr 3 08:29:18 2019 -0700

    HIVE-21568: HiveRelOptUtil.isRowFilteringPlan should skip Project (Jesus 
Camacho Rodriguez, reviewed by Vineet Garg)
---
 .../hadoop/hive/ql/optimizer/calcite/HiveRelOptUtil.java | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelOptUtil.java 
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelOptUtil.java
index 2c2f91b..1312561 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelOptUtil.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelOptUtil.java
@@ -495,22 +495,16 @@ public class HiveRelOptUtil extends RelOptUtil {
         mq.getNodeTypes(operator);
     for (Entry<Class<? extends RelNode>, Collection<RelNode>> e :
         nodesBelowNonFkInput.asMap().entrySet()) {
+      if (e.getKey() == Project.class) {
+        // It does not alter cardinality, continue
+        continue;
+      }
+
       if (e.getKey() == TableScan.class) {
         if (e.getValue().size() > 1) {
           // Bail out as we may not have more than one TS on non-FK side
           return true;
         }
-      } else if (e.getKey() == Project.class) {
-        // We check there is no windowing expression
-        for (RelNode node : e.getValue()) {
-          Project p = (Project) node;
-          for (RexNode expr : p.getChildExps()) {
-            if (expr instanceof RexOver) {
-              // Bail out as it may change cardinality
-              return true;
-            }
-          }
-        }
       } else if (e.getKey() == Aggregate.class) {
         // We check there is are not grouping sets
         for (RelNode node : e.getValue()) {

Reply via email to