amaliujia commented on a change in pull request #1602: [CALCITE-3531] 
AggregateProjectPullUpConstantsRule should not remove …
URL: https://github.com/apache/calcite/pull/1602#discussion_r349762808
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexUtil.java
 ##########
 @@ -514,9 +514,13 @@ public Boolean visitDynamicParam(RexDynamicParam 
dynamicParam) {
     }
 
     public Boolean visitCall(RexCall call) {
-      // Constant if operator is deterministic and all operands are
-      // constant.
-      return call.getOperator().isDeterministic()
 
 Review comment:
   Danny mentions in the JIRA that if it's a batch job that runs cross days, 
the result is wrong. 
   
   My understanding is if `current_timestamp` is called in different day 
because batch job could be large, then it returns a different 
`current_timestamp`,  do I misunderstand it? If my understanding is correct, 
then if we say a batch query is in a transaction, it sounds more like 
`current_timestamp` implementation is wrong.
   
   I found that in SqlFunctions, `current_timestamp` is marked as 
non-deterministic: 
https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java#L2235
   
    

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to