zabetak commented on a change in pull request #2504:
URL: https://github.com/apache/hive/pull/2504#discussion_r676760020



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/jdbc/JDBCAbstractSplitFilterRule.java
##########
@@ -127,7 +127,9 @@ public void onMatch(RelOptRuleCall call, SqlDialect 
dialect) {
     ArrayList<RexCall> validJdbcNode = visitor.getValidJdbcNode();
     ArrayList<RexCall> invalidJdbcNode = visitor.getInvalidJdbcNode();
 
-    assert validJdbcNode.size() != 0 && invalidJdbcNode.size() != 0;
+    if( validJdbcNode.size() == 0 || invalidJdbcNode.size() == 0) {
+      return;
+    }

Review comment:
       If we cannot split the filter then we don't need to enter the `onMatch` 
method. A few lines above there seems to be a method:
   ```
   public boolean canBeSplit() {
         return !validJdbcNode.isEmpty() && !invalidJdbcNode.isEmpty();
       }
   ```
   with the same condition. 
   I think the check should be part of `matches` method so we don't fire the 
rule if there is nothing to do.




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