[SPARK-46331][SQL][FOLLOWUP] Time travel should support current datetime functions#45476
Closed
cloud-fan wants to merge 1 commit intoapache:masterfrom
Closed
[SPARK-46331][SQL][FOLLOWUP] Time travel should support current datetime functions#45476cloud-fan wants to merge 1 commit intoapache:masterfrom
cloud-fan wants to merge 1 commit intoapache:masterfrom
Conversation
Contributor
Author
MaxGekk
approved these changes
Mar 12, 2024
dbatomic
reviewed
Mar 12, 2024
| ComputeCurrentTime(ReplaceExpressions(fakeProject)).asInstanceOf[Project] | ||
| .expressions.head.asInstanceOf[Alias].child | ||
| } | ||
| tsToEval.foreach { |
Contributor
There was a problem hiding this comment.
Btw, seems like "pre-eval" is needed in a couple of places (e.g. inline tables).
In future, it would be good if we could add some helper that will do all the safe pre-evals:
- Runtime replaceable
- ComuteCurrentTime
- ReplaceCurrentTime
In short, there are places where finishAnalysis rules, which are part of QO phase, need to be executed before entering QO.
dbatomic
approved these changes
Mar 12, 2024
Member
|
+1, LGTM. Merging to master. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This is a followup of #44261 to fix one regression: we missed one exception that time travel needs to evaluate current datetime functions before the analysis phase completes. This PR fixes it by explicitly compute current datetime values in the time travel handling.
Why are the changes needed?
re-support current datetime functions as time travel timestamp
Does this PR introduce any user-facing change?
no, the regression has not been released yet.
How was this patch tested?
new test
Was this patch authored or co-authored using generative AI tooling?
no