You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/12/03 07:57:56 UTC

[GitHub] [hive] kgyrtkirk commented on a change in pull request #2839: HIVE-25766: java.util.NoSuchElementException in HiveFilterProjectTran…

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



##########
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
+      if (inputRefs.isEmpty()) {

Review comment:
       this is interesting...I think we shouldn't have the  `IS NOT NULL` at all.... why don't we run `RexSimplify` in `unknownAsFalse` mode?
   
   we may make that change independently from this change - but `uAF` could probably identify more opportunities in case the outer is not an `IS NOT NULL`

##########
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:
       the above code blindly states that the top level call is an `IS NOT NULL` without even checking it
   can we be sure in that? because it seems like it removes the top level call without even a check!
   




-- 
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: gitbox-unsubscribe@hive.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org