yjshen commented on a change in pull request #1487:
URL: https://github.com/apache/arrow-rs/pull/1487#discussion_r835898239
##########
File path: arrow/src/array/ord.rs
##########
@@ -225,6 +225,11 @@ pub fn build_compare(left: &dyn Array, right: &dyn Array)
-> Result<DynComparato
}
}
}
+ (Decimal(_, _), Decimal(_, _)) => {
+ let left: DecimalArray = DecimalArray::from(left.data().clone());
+ let right: DecimalArray = DecimalArray::from(right.data().clone());
+ Box::new(move |i, j| left.value(i).cmp(&right.value(j)))
Review comment:
I think it's validated in the beginning of this function
```rust
pub fn build_compare(left: &dyn Array, right: &dyn Array) ->
Result<DynComparator> {
use DataType::*;
use IntervalUnit::*;
use TimeUnit::*;
Ok(match (left.data_type(), right.data_type()) {
(a, b) if a != b => {
return Err(ArrowError::InvalidArgumentError(
"Can't compare arrays of different types".to_string(),
));
}
```
--
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]