alamb commented on code in PR #4575:
URL: https://github.com/apache/arrow-rs/pull/4575#discussion_r1283675427
##########
arrow-ord/src/partition.rs:
##########
@@ -17,22 +17,64 @@
//! Defines partition kernel for `ArrayRef`
-use crate::sort::{LexicographicalComparator, SortColumn};
-use arrow_schema::ArrowError;
-use std::cmp::Ordering;
use std::ops::Range;
-/// Given a list of already sorted columns, returns [`Range`]es that
-/// partition the input such that each partition has equal values
-/// across sort columns.
+use arrow_array::{Array, ArrayRef};
+use arrow_buffer::BooleanBuffer;
+use arrow_schema::ArrowError;
+
+use crate::comparison::neq_dyn;
+use crate::sort::SortColumn;
+
+/// A computed set of partitions, see [`partition`]
+#[derive(Debug, Clone)]
+pub struct Partitions(Option<BooleanBuffer>);
+
+impl Partitions {
+ /// Returns the range of each partition
+ ///
+ /// Consecutive ranges will be contiguous: i.e [`(a, b)` and `(b, c)`], and
+ /// `start = 0` and `end = self.len()` for the first and last range
respectively
+ pub fn ranges(&self) -> Vec<Range<usize>> {
Review Comment:
I messed around with trying to make this work but got stymied by the borrow
checker -- specifically that the `BitIndexIterator` had a reference so I
couldn't embed it in another iterator.
--
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]