blaginin commented on code in PR #14402:
URL: https://github.com/apache/datafusion/pull/14402#discussion_r1942760557
##########
datafusion/functions-aggregate/src/first_last.rs:
##########
@@ -627,24 +607,19 @@ impl Accumulator for LastValueAccumulator {
// last index contains is_set flag.
let is_set_idx = states.len() - 1;
let flags = states[is_set_idx].as_boolean();
- let filtered_states = filter_states_according_to_is_set(states,
flags)?;
+ let filtered_states =
+ filter_states_according_to_is_set(&states[0..is_set_idx], flags)?;
// 1..is_set_idx range corresponds to ordering section
- let sort_cols = convert_to_sort_cols(
+ let sort_columns = convert_to_sort_cols(
&filtered_states[1..is_set_idx],
self.ordering_req.as_ref(),
);
- let ordered_states = if sort_cols.is_empty() {
- // When no ordering is given, use existing state as is:
- filtered_states
- } else {
- let indices = lexsort_to_indices(&sort_cols, None)?;
- take_arrays(&filtered_states, &indices, None)?
- };
+ let comparator = LexicographicalComparator::try_new(&sort_columns)?;
Review Comment:
Tried `RowConverter` too, it's actually 40% slower than slowing everything
as is 😱
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]