MaxGekk opened a new pull request #29892:
URL: https://github.com/apache/spark/pull/29892


   ### What changes were proposed in this pull request?
   Explicitly document that `current_date` and `current_timestamp` are executed 
at the start of query evaluation. And all calls of 
`current_date`/`current_timestamp` within the same query return the same value
   
   ### Why are the changes needed?
   Users could expect that `current_date` and `current_timestamp` return the 
current date/timestamp at the moment of query execution but in fact the 
functions are folded by the optimizer at the start of query evaluation:
   
https://github.com/apache/spark/blob/0df8dd60733066076967f0525210bbdb5e12415a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/finishAnalysis.scala#L71-L91
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   by running `./dev/scalastyle`.


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to