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


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -1954,8 +1964,16 @@ && requireNonNull(((SqlNumericLiteral) 
node).bigDecimalValue())
         }
         SqlNode newOperand =
             performUnconditionalRewrites(operand, childUnderFrom);
-        if (newOperand != null && newOperand != operand) {
-          call.setOperand(i, newOperand);
+        if (newOperand != operand) {
+          if (call instanceof SqlOrderBy) {

Review Comment:
   I think this is a bug, perhaps the right thing is to make it mutable like 
all other SqlNodes



##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -1913,7 +1918,12 @@ && requireNonNull(((SqlNumericLiteral) 
node).bigDecimalValue())
               type.getFullTypeString()));
     }
   }
-
+  private static SqlCall withOperand(SqlCall call, int i, SqlNode operand) {

Review Comment:
   no empty line?
   this seems to have exactly one call site, why not inline it?
   



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