tkalkirill commented on code in PR #5004:
URL: https://github.com/apache/calcite/pull/5004#discussion_r3602459316


##########
core/src/main/java/org/apache/calcite/tools/RelBuilder.java:
##########
@@ -3884,6 +3892,44 @@ public RelBuilder sortLimit(@Nullable RexNode 
offsetNode, @Nullable RexNode fetc
     return this;
   }
 
+  private static boolean isValidFetchExpression(RexNode node) {
+    return Boolean.TRUE.equals(
+        node.accept(
+            new RexVisitorImpl<@Nullable Boolean>(true) {
+              @Override public Boolean visitLiteral(RexLiteral literal) {
+                return true;
+              }
+
+              @Override public Boolean visitDynamicParam(RexDynamicParam 
dynamicParam) {
+                return true;
+              }
+
+              @Override public Boolean visitCall(RexCall call) {
+                if (call.getOperator().isAggregator()) {
+                  return false;
+                }
+                for (RexNode operand : call.getOperands()) {
+                  if (!Boolean.TRUE.equals(operand.accept(this))) {
+                    return false;
+                  }
+                }
+                return true;
+              }
+
+              @Override public Boolean visitOver(RexOver over) {

Review Comment:
   Good catch, I fixed 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to