xiedeyantu commented on code in PR #4355:
URL: https://github.com/apache/calcite/pull/4355#discussion_r2073217842


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -1528,7 +1528,9 @@ private void handleOffsetFetch(@Nullable SqlNode offset, 
@Nullable SqlNode fetch
           ((SqlBasicCall) call).setOperator(overloads.get(0));
         }
       }
-      if (config.callRewrite()) {
+      if (config.callRewrite()
+          // Do not rewrite calls that contain subqueries
+          && !SqlUtil.containsCall(call, c -> c.getKind() == SqlKind.SELECT)) {

Review Comment:
   I assume this is reasonable, would it be better to make a 
judgment[here](https://github.com/apache/calcite/blob/eeb9c3d076889a5bf25d28a24318e5c1c6c89549/core/src/main/java/org/apache/calcite/sql/fun/SqlCoalesceFunction.java#L57).



##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -1528,7 +1528,9 @@ private void handleOffsetFetch(@Nullable SqlNode offset, 
@Nullable SqlNode fetch
           ((SqlBasicCall) call).setOperator(overloads.get(0));
         }
       }
-      if (config.callRewrite()) {
+      if (config.callRewrite()
+          // Do not rewrite calls that contain subqueries
+          && !SqlUtil.containsCall(call, c -> c.getKind() == SqlKind.SELECT)) {

Review Comment:
   I assume this is reasonable, would it be better to make a judgment 
[here](https://github.com/apache/calcite/blob/eeb9c3d076889a5bf25d28a24318e5c1c6c89549/core/src/main/java/org/apache/calcite/sql/fun/SqlCoalesceFunction.java#L57).



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