-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support extract(... from ...)
#450
Conversation
0b83f64
to
474eb7b
Compare
ae71b67
to
f747e84
Compare
if ((aggoid == g_oid_cache.sum_noise || | ||
aggoid == g_oid_cache.avg_noise) && | ||
TypeCategory(linitial_oid(aggref->aggargtypes)) == TYPCATEGORY_DATETIME) | ||
FAILWITH_LOCATION(aggref->location, "Unsupported aggregate in query."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these aggregators allowed by type system while sum(timestamp)
isn't? Can't we make the argument type identical with the original?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I'm not sure I can explain this well, but I think this comes of the fact, that sum
comes in many flavors, and sum(timestamp)
isn't one. We track and rewrite all of these flavors to "our" anon_sum(any)
.
With _noise
it is not rewritten but it is our own user-defined aggregate and it comes in one flavor diffix.sum_noise(any)
from the "beginning". We could in theory define multiple flavors of dummy sum_noise
and rewrite them to sum_noise_anon
, to have the same semantics as sum
. I don't remember anymore, why this path wasn't chosen (simplicity probably). I'm not sure if we have enough justification to do it now or if it's possible at all.
f747e84
to
8e82bad
Compare
... with a bonus bugfix