[ 
https://issues.apache.org/jira/browse/HIVE-23973?focusedWorklogId=465706&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-465706
 ]

ASF GitHub Bot logged work on HIVE-23973:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Aug/20 14:04
            Start Date: 03/Aug/20 14:04
    Worklog Time Spent: 10m 
      Work Description: kasakrisz commented on a change in pull request #1349:
URL: https://github.com/apache/hive/pull/1349#discussion_r464309156



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterJoinRule.java
##########
@@ -52,14 +55,34 @@ protected HiveFilterJoinRule(RelOptRuleOperand operand, 
String id, boolean smart
     super(operand, id, smart, relBuilderFactory, TRUE_PREDICATE);
   }
 
+  /**
+   * Rule that tries to push filter expressions into a join condition and into
+   * the inputs of the join, iff the join is a column appending
+   * non-filtering join.
+   */
+  public static class HiveFilterNonFilteringJoinMergeRule extends 
HiveFilterJoinMergeRule {
+
+    @Override
+    public boolean matches(RelOptRuleCall call) {
+      Join join = call.rel(1);
+      RewritablePKFKJoinInfo joinInfo = HiveRelOptUtil.isRewritablePKFKJoin(
+          join, true, call.getMetadataQuery());
+      if (!joinInfo.rewritable) {
+        return false;
+      }
+      return super.matches(call);
+    }
+
+  }
+
   /**
    * Rule that tries to push filter expressions into a join condition and into
    * the inputs of the join.
    */
   public static class HiveFilterJoinMergeRule extends HiveFilterJoinRule {
     public HiveFilterJoinMergeRule() {
-      super(RelOptRule.operand(Filter.class, RelOptRule.operand(Join.class, 
RelOptRule.any())),
-          "HiveFilterJoinRule:filter", true, HiveRelFactories.HIVE_BUILDER);
+      super(operand(Filter.class, operand(Join.class, any())),
+          null, true, HiveRelFactories.HIVE_BUILDER);

Review comment:
       nit: you can expose the `id` parameter to the constructor of 
`HiveFilterJoinMergeRule `




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 465706)
    Time Spent: 20m  (was: 10m)

> Use SQL constraints to improve join reordering algorithm (III)
> --------------------------------------------------------------
>
>                 Key: HIVE-23973
>                 URL: https://issues.apache.org/jira/browse/HIVE-23973
>             Project: Hive
>          Issue Type: Improvement
>          Components: CBO
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> This issue focuses on pulling non-filtering column appending FK-PK joins to 
> the top of the plan. Among other improvements, this will avoid unnecessary 
> shuffling of data in intermediate stages.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to