alamb commented on a change in pull request #1115:
URL: https://github.com/apache/arrow-rs/pull/1115#discussion_r777196959
##########
File path: arrow/src/compute/kernels/comparison.rs
##########
@@ -888,6 +890,375 @@ pub fn gt_eq_utf8_scalar<OffsetSize:
StringOffsetSizeTrait>(
compare_op_scalar!(left, right, |a, b| a >= b)
}
+macro_rules! dyn_compare_scalar {
+ // Applies `LEFT OP RIGHT` when `LEFT` is a `DictionaryArray`
+ ($LEFT: expr, $RIGHT: expr, $OP: ident) => {{
+ let right: i128 = $RIGHT.try_into().map_err(|_| {
+ ArrowError::ComputeError(String::from("Can not convert scalar to
i128"))
+ })?;
+ match $LEFT.data_type() {
+ DataType::Int8 => {
Review comment:
@matthewmturner your assessment is correct.
I think supporting `Float32Array` and `Float64Array` would be reasonable
here.
As you say, however, the use of the intermediate `i128` makes using `f32`
and `f64` as the constant values not possible without a loss of precision.
🤔 we should probably file a ticket to sort this out (probably via some sort
of trait).
--
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]