-
Notifications
You must be signed in to change notification settings - Fork 594
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
expr: give a clear definition of the "volatility" for all expressions #9030
Comments
|
Do/can we check if a user provided the correct category in |
No we can't 😄 |
Ignore me, I'm stupid. I get it:
(So NOW is STABLE and RANDOM is VOLATILE I'm asking this while wondering how many optimizations should consider volatility, after seeing #9133. BTW, CSE should be one. 🥸 https://twitter.com/zty0826/status/1609584138490904577 |
#9133 has roughly divided all expressions into |
I guess currently |
Recently there're more and more features that require expressions to be categorized, here're some examples:
Project
output for indeterministic expressions on retractable stream. (feat(frontend): addStreamProjectMaterialize
PlanNode #8843)I think it's time for us to give a clear definition of the "volatility" for all expressions, just like the definition in Postgres: https://www.postgresql.org/docs/current/xfunc-volatility.html.
Based on these definitions, we have:
IMMUTABLE
expressions (except for UDF).STABLE
andVOLATILE
functions, we need to persist the result in case of deletes.IMMUTABLE
functions are allowed in functional indexes and non-NULL default values.cc @xiangjinwu @wangrunji0408 @chenzl25
The text was updated successfully, but these errors were encountered: