soumyakanti3578 commented on code in PR #6601:
URL: https://github.com/apache/hive/pull/6601#discussion_r3584416153


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTransposeRule.java:
##########
@@ -338,11 +338,14 @@ public void visit(RelNode node, int ordinal, RelNode 
parent) {
         if (node instanceof Filter) {
           check((Filter) node);
         } else if (node instanceof Project) {
+          Project project = (Project) node;
           RexNode condition = HiveRelOptUtil.pushPastProjectUnlessBloat(
-              filterCondition, (Project) node, bloat);
-          if (condition != null) {
-            filterCondition = condition;
+              filterCondition, project, bloat);
+          if (condition == null) {
+            // the condition could not be pushed, so bail out
+            return;
           }
+          filterCondition = condition;

Review Comment:
   nit: This can be rewritten as 
   ```
   node instanceof Project project
   ```
   and also I think `filterCondition` can be directly assigned 
`HiveRelOptUtil.pushPastProjectUnlessBloat(
                 filterCondition, project, bloat);` without any side effects?
   
   Neither of these are needed for the PR btw so I will leave it up to you.



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