silundong commented on code in PR #4324:
URL: https://github.com/apache/calcite/pull/4324#discussion_r2065169285


##########
core/src/main/java/org/apache/calcite/rex/RexUtil.java:
##########
@@ -2799,6 +2800,175 @@ private RexNode or(Iterable<? extends RexNode> nodes) {
     }
   }
 
+  /**
+   * Helper class that expands predicates from disjunctions (splited by K).
+   *
+   * @param <K> The dimension used to split predicates in disjunctions. If you 
want to expand
+   *           predicates that can be pushed down to a single table from the 
disjunction, K is
+   *           {@link RelTableRef}; if you want to expand predicates that can 
be pushed down to
+   *           Join inputs from the disjunction, K is string whose value is 
'left' or 'right'.
+   */
+  public abstract static class ExpandDisjunctionHelper<K> {
+    private final RelBuilder relBuilder;
+
+    private final int maxNodeCount;
+
+    // Used to record the number of redundant expressions expanded.

Review Comment:
   I've seen other places use it through subclass extends, maybe that makes it 
easier to understand why the exception is thrown. There's an OverflowError in 
CnfHelper, which also prevents combinatorial explosion. Maybe a common 
exception can be abstracted under RexUtil, which can be used by both CnfHelper 
and ExpandDisjunctionHelper?



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

Reply via email to