You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case of aggregating a single field or literal, a compounding aggregation causes an error, while aggregating record-wise allows an aggregation on top. Here is an example:
SELECT sum(unionall(1,2,3,4)); -- works
SELECT sum(unionall([1,2,3,4])); -- errors
Specifically the error is Cannot calculate an aggregate function of another aggregate function. I understand this limitation conceptually as a type-change is induced by a single argument aggregation, but on the other hand a function should be able to operate on a legal argument with disregard on how it was obtained.
SELECT sum(first((SELECT unionall([1,2,3,4]) as x)).x)
works.
I am just asking this here separately due to specific error message Cannot calculate an aggregate function of another aggregate function, when should this error (actually?) be triggered?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In the case of aggregating a single field or literal, a compounding aggregation causes an error, while aggregating record-wise allows an aggregation on top. Here is an example:
Specifically the error is
Cannot calculate an aggregate function of another aggregate function
. I understand this limitation conceptually as a type-change is induced by a single argument aggregation, but on the other hand a function should be able to operate on a legal argument with disregard on how it was obtained.This may also just resolve with #1037 , since:
works.
I am just asking this here separately due to specific error message
Cannot calculate an aggregate function of another aggregate function
, when should this error (actually?) be triggered?Thank you
Beta Was this translation helpful? Give feedback.
All reactions