rubenada commented on code in PR #2763:
URL: https://github.com/apache/calcite/pull/2763#discussion_r847065258


##########
core/src/main/java/org/apache/calcite/tools/RelBuilder.java:
##########
@@ -3196,12 +3197,40 @@ public RelBuilder sort(RelCollation collation) {
    */
   public RelBuilder sortLimit(int offset, int fetch,
       Iterable<? extends RexNode> nodes) {
+    final @Nullable RexNode offsetNode = offset <= 0 ? null : literal(offset);
+    final @Nullable RexNode fetchNode = fetch < 0 ? null : literal(fetch);
+    if (offsetNode == null && fetch == 0 && config.simplifyLimit()) {

Review Comment:
   Sorry, I know I was the one that proposed this code, but I think we should 
not include this `if (...) return empty()` simplification, because it will be a 
duplication (this same simplification will be part any way of the overloaded 
method with RexNode parameters, so I think we should remove it from this one).



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