xuzifu666 commented on code in PR #5132:
URL: https://github.com/apache/calcite/pull/5132#discussion_r3679458766


##########
core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java:
##########
@@ -231,6 +231,24 @@ private static boolean isEmpty(RelNode node) {
   public static final RelOptRule SORT_FETCH_ZERO_INSTANCE =
       SortFetchZeroRuleConfig.DEFAULT.toRule();
 
+  /**
+   * Rule that converts a {@link org.apache.calcite.rel.core.Sort}
+   * to empty if its {@code OFFSET} is greater than or equal to the maximum
+   * number of rows its input can produce, so that all rows are skipped.
+   *
+   * <p>Examples:
+   *
+   * <ul>
+   * <li>Sort[offset=5](input with at most 2 rows) becomes Empty
+   * </ul>
+   *
+   * <p>It relies on {@link org.apache.calcite.rel.metadata.RelMdMaxRowCount}

Review Comment:
   Thanks for the reminder; this part doesn't actually need a comment, and the 
existing rules already cover it, so I'll remove that comment for now.



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