Skip to content

Commit d2d8ca9

Browse files
committed
add todo.
1 parent 4725234 commit d2d8ca9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

datafusion/functions-aggregate/src/median.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,13 @@ impl<T: ArrowNumericType + Send> GroupsAccumulator for MedianGroupsAccumulator<T
387387
cur_len += group_value.len() as i32;
388388
offsets.push(cur_len);
389389
}
390+
// TODO: maybe we can use `OffsetBuffer::new_unchecked` like what in `convert_to_state`,
391+
// but safety should be considered more carefully here(and I am not sure if it can get
392+
// performance improvement when we introduce checks to keep the safety...).
393+
//
394+
// Can see more details in:
395+
// https://github.com/apache/datafusion/pull/13681#discussion_r1931209791
396+
//
390397
let offsets = OffsetBuffer::new(ScalarBuffer::from(offsets));
391398

392399
// Build inner array

0 commit comments

Comments
 (0)