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


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -3911,14 +3918,21 @@ void checkAnd(SqlCall call) {
       }
     }
 
-    @Override public @Nullable SqlNode visit(final 
org.apache.calcite.sql.SqlCall call) {
+    @Override public @Nullable SqlNode visit(final SqlCall call) {
       SqlKind kind = call.getKind();
-      if (kind != SqlKind.AND && kind != SqlKind.EQUALS) {
+      if (kind != SqlKind.AND && kind != SqlKind.EQUALS && kind != 
SqlKind.CAST) {
         illegal = true;

Review Comment:
   the extra {} are actually useful, they create a local scope, and the 
variables in the local scope do not interfere with variables from the rest of 
the function. It also prevents accidental updates to other variables that may 
be in scope. If also helps with the debugger too: such variables go out of 
scope when the inner scope {} terminates, so in large functions with lots of 
variables it makes the debugging experience better. I use this trick a lot when 
I have to write very large 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