danny0405 commented on a change in pull request #2238:
URL: https://github.com/apache/calcite/pull/2238#discussion_r517834372



##########
File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
##########
@@ -2710,6 +2710,16 @@ private boolean accept1(RexNode e, SqlKind kind,
       }
     }
 
+    /** Checks whether it is worth to fix and convert to {@code SEARCH} calls. 
*/
+    boolean needToFix(int newTermsCnt) {
+      // Fix and converts to SEARCH if:
+      // 1. A Sarg has complexity greater than 1;
+      // 2. The terms are reduced as simpler Sarg points.
+      return map.values().stream().anyMatch(b -> b.complexity() > 1)

Review comment:
       Sorry i found that it is hard to keep the decision branches in just one 
`for loop` and make the logic clear and clean. So i would not follow that.




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


Reply via email to