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
Support multiple ordered array_agg aggregations (#16625)
* Validate states shape in merge_batch
Due to `..` in the pattern, the
`OrderSensitiveArrayAggAccumulator::merge_batch` did not validate it's
not receiving additional states columns it ignores. Update the code to
check number of inputs.
* Support multiple ordered array_agg
Before the change, `array_agg` with ordering would depend on input being
ordered. As a result, it was impossible to do two or more `array_agg(x
ORDER BY ...)` with incompatible ordering. This change moves ordering
responsibility into `OrderSensitiveArrayAggAccumulator`. When input is
pre-ordered (beneficial ordering), no additional work is done. However,
when it's not, `array_agg` accumulator will order the data on its own.
* Generate sorts based on aggregations soft requirements
The sorting consideration before aggregations did respect only ordered
aggregation functions with `AggregateOrderSensitivity::HardRequirement`.
This change includes sorting expectations from
`AggregateOrderSensitivity::Beneficial` functions. When beneficial
ordered function requirements are not satisfied, no error is raised,
they are considered in the second pass only.
* Fix reversing first_value, last_value
Upon reversing, a schema and field mismatch would happen.
* Revert "Fix reversing first_value, last_value"
This reverts commit 9b7e94d.
* sort array_agg input the old way whenever possible
* revert some now unnecessary change
* Improve doc for SoftRequiement
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
* Add comment for include_soft_requirement
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
* Document include_soft_requirement param
* fmt
* doc fix
---------
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
0 commit comments