asolimando commented on a change in pull request #2839:
URL: https://github.com/apache/hive/pull/2839#discussion_r761798081



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTransposeRule.java
##########
@@ -339,6 +339,11 @@ private void check(Filter filter) {
       final RexNode filterCondition = simplify.simplify(filter.getCondition());
 
       final Set<Integer> inputRefs = 
HiveCalciteUtil.getInputRefs(newCondition);
+      // if the new IS NOT NULL has no input ref, there is redundancy here, 
bail out

Review comment:
       This auxiliary method is only called in the context of this method, 
which only targets `IS NOT NULL` calls: 
[HiveFilterProjectTransposeRule.java#L265](https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTransposeRule.java#L265)
   
   The `check` method does not remove any call by itself, it is just in charge 
to check if the new `IS NOT NULL` that we want to create would not be 
redundant, if so it prevents the push by making the rule bail out.
   
   I agree that the name of the method is not ideal, maybe we can rename it as 
`checkRedundancyOfIsNotNull` or something along that line?




-- 
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.

To unsubscribe, e-mail: [email protected]

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