tustvold commented on code in PR #3187:
URL: https://github.com/apache/arrow-rs/pull/3187#discussion_r1031807817
##########
arrow/src/array/ord.rs:
##########
@@ -303,6 +303,26 @@ pub fn build_compare(left: &dyn Array, right: &dyn Array)
-> Result<DynComparato
Box::new(move |i, j| left.value(i).cmp(right.value(j)))
}
+ (Struct(f), Struct(_)) => {
+ let left = as_struct_array(left);
+ let right = as_struct_array(right);
+
+ let comparators = (0..f.len())
+ .map(|idx| {
+ build_compare(left.column(idx).as_ref(),
right.column(idx).as_ref())
+ })
+ .collect::<Result<Vec<_>>>()?;
+
+ Box::new(move |i, j| {
+ for c in &comparators {
+ match c(i, j) {
Review Comment:
The performance will not be spectacular, but as mentioned on #3185
performant comparisons should be performed using the row format - this is
mainly for completeness
--
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]