materialize
materialize copied to clipboard
Support additional aggregate functions
- [ ]
bool_or
- [ ]
bool_and
- [x]
array_agg
Probably more! Please comment on this issue if you encounter others we're missing.
See here. These are aggregates that return the OR/AND of their inputs. Note that their behaviour is actually distinct from the dataflow Any
and All
aggregates in the presence of NULL
.
Going to generalize this to missing aggregates more broadly.
Note that their behaviour is actually distinct from the dataflow Any and All aggregates in the presence of NULL.
But they can be determined from dataflow Any
and All
, right, by mapping NULL
to true and false, respectively?
Ah no they can't because while they ignore NULL in their inputs, they produce NULL on empty inputs. What a world!
We should probably just delete Any
and All
and require everyone to rewrite aggregates in to Sum
and finish with the domain-specific logic they require.
Related: #2813
It would be nice to have list_agg
here, as it could provide (I imagine) a more efficient alternative to jsonb_agg
in several cases.
To be clear, I would prefer for list_agg
to return a proper list, similar to array_agg
, instead of the SQL2016 version that returns a string.
@andrioni just a heads up that list_agg
and array_agg
just landed!