kasakrisz commented on a change in pull request #2196:
URL: https://github.com/apache/hive/pull/2196#discussion_r622058227



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/views/HiveAggregateIncrementalRewritingRuleBase.java
##########
@@ -203,17 +147,42 @@ public void onMatch(RelOptRuleCall call) {
               elseReturn));
     }
 
+    int flagIndex = joinLeftInput.getRowType().getFieldCount() - 1;
+    RexNode flagNode = rexBuilder.makeInputRef(
+            join.getRowType().getFieldList().get(flagIndex).getType(), 
flagIndex);
+
     // 6) Build plan
-    // Split this filter condition in 
CalcitePlanner.fixUpASTAggregateIncrementalRebuild:
-    // First disjunct for update branch
-    // Second disjunct for insert branch
-    RexNode filterCond = rexBuilder.makeCall(
-            SqlStdOperatorTable.OR, flagNode, 
rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, flagNode));
-    RelNode newNode = call.builder()
+    RelNode newNode = relBuilder
         .push(join)
-        .filter(filterCond)
+        .filter(createFilterCondition(joinRightInput, flagNode, projExprs, 
relBuilder))
         .project(projExprs)
         .build();
     call.transformTo(newNode);
   }
+
+  protected abstract T createJoinRightInput(RelOptRuleCall call);
+
+  protected static class RightInput {

Review comment:
       Renamed




-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to