-
Notifications
You must be signed in to change notification settings - Fork 613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(expr): refactor timezone-related expr impl #14313
Conversation
ecd2fe7
to
02c4915
Compare
542246f
to
704b20b
Compare
e8488f5
to
979a94a
Compare
Looks like there were some misunderstandings of the previous rewriting based approach. Let me share some backgrounds of these expressions. Some expressions (in AST) do not depend on the implicit session timezone. They take an explicit parameter of timezone (usually last one):
They served as the basis of rewriting. The impure variant (e.g. when last timezone parameter is optional and absent) is rewritten into the corresponding pure variant. However, they would still exist even if we used context based approach since day 0. This makes them different from the following group of imaginary implementations, which were introduced solely for the purpose of being rewriting targets:
As for the expressions (in AST) that depend on implicit session timezone:
However, I just come up with a risk of providing context-based implementation on existing common ExprType |
This PR has been open for 60 days with no activity. Could you please update the status? Feel free to ping a reviewer if you are waiting for review. |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This PR is tring to take place of the current rewrite mechanism, using captured context (introduced in #13702) to impl expr related to timezone.
The detailed backgroud and motivation can be found here.
This PR introduce a new session variable:
enable_timezone_rewriting
. If enabled, frontend will rewriting function all to provide timezone. Otherwise, captured context will be used to offer timezone.This PR may block the const folding optimization of some functions in some secnario.
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.