[SQL][MINOR] Add timezone to replacement of Uniform #53615
+5
−16
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?
Added the timezone to the CAST that happens in the replacement of the UNIFORM expression.
Why are the changes needed?
Since this Cast doesn't need any information about time zones, they are not explicitly needed. However, ResolveTimeZone in the analyzer does put the timezone into every cast created before analysis. This causes a problem between the fixed-point and single-pass analyzer, since reanalyzing queries produces different results (single-pass reanalyzes the plan and puts the timezone for the new Cast, while the fixed-point considers the Cast already resolved and doesn't do anything).
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Single pass analyzer is enabled in dual run mode in the cte-recursion golden file (and ctePrecedencePolicy isn't set to EXCEPTION), so the golden file is being ran on in the singe-pass analyzer. However, since recursive CTEs are still not in single pass, the new analyzer is only invoked in the recursion steps. Without this change, the query
fails with plan_mismatch_error (while executing the anchor).
Was this patch authored or co-authored using generative AI tooling?
No.