Jefffrey commented on code in PR #9368:
URL: https://github.com/apache/arrow-rs/pull/9368#discussion_r2776992049
##########
arrow-ord/src/ord.rs:
##########
@@ -1690,4 +1734,125 @@ mod tests {
assert_eq!(cmp(0, 1), Ordering::Equal);
assert_eq!(cmp(2, 0), Ordering::Equal);
}
+
+ #[test]
+ fn test_run_end_encoded_int32() {
Review Comment:
Could we add a test with sliced run arrays
##########
arrow-ord/src/ord.rs:
##########
@@ -480,6 +502,28 @@ pub fn make_comparator(
) -> Result<DynComparator, ArrowError> {
use arrow_schema::DataType::*;
+ // Handle RunEndEncoded arrays first
Review Comment:
Could we fold this into the downcast macro below, since it seems we do so
for dictionaries?
##########
arrow-ord/src/ord.rs:
##########
@@ -24,6 +24,28 @@ use arrow_buffer::{ArrowNativeType, NullBuffer};
use arrow_schema::{ArrowError, DataType, SortOptions};
use std::{cmp::Ordering, collections::HashMap};
+fn compare_run_end_encoded<R: RunEndIndexType>(
+ left: &dyn Array,
+ right: &dyn Array,
+ opts: SortOptions,
+) -> Result<DynComparator, ArrowError> {
+ let left = left.as_any().downcast_ref::<RunArray<R>>().unwrap();
Review Comment:
Can use
[`as_run`](https://docs.rs/arrow/latest/arrow/array/trait.AsArray.html#method.as_run)
here
--
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]