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


##########
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()

Review Comment:
   Indeed, there will be expression not rewritten.
   I think that the right solution is to have a separate optimization pass 
which can rewrite such expressions after validation. We can file an issue about 
this.
   I think that doing these rewrites unconditionally is wrong.
   In our compiler we have disabled rewrites in the configuration of the 
validator.
   This also affects some date functions.



##########
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()

Review Comment:
   Indeed, there will be expressions not rewritten.
   I think that the right solution is to have a separate optimization pass 
which can rewrite such expressions after validation. We can file an issue about 
this.
   I think that doing these rewrites unconditionally is wrong.
   In our compiler we have disabled rewrites in the configuration of the 
validator.
   This also affects some date functions.



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