matthewmturner commented on a change in pull request #1074:
URL: https://github.com/apache/arrow-rs/pull/1074#discussion_r774044776
##########
File path: arrow/src/compute/kernels/comparison.rs
##########
@@ -898,6 +898,126 @@ pub fn gt_eq_utf8_scalar<OffsetSize:
StringOffsetSizeTrait>(
compare_op_scalar!(left, right, |a, b| a >= b)
}
+macro_rules! dyn_cmp_scalar {
+ ($LEFT: expr, $RIGHT: expr, $T: ident, $OP: ident, $TT: tt) => {{
+ let left = $LEFT.as_any().downcast_ref::<$T>().ok_or_else(|| {
+ ArrowError::CastError(format!(
+ "Left array cannot be cast to {}",
+ type_name::<$T>()
+ ))
+ })?;
+ let right = $RIGHT.as_any().downcast_ref::<$T>().ok_or_else(|| {
+ ArrowError::CastError(format!(
+ "Right array cannot be cast to {}",
+ type_name::<$T>(),
+ ))
+ })?;
+ $OP::<$TT>(left, right)
+ }};
+}
+
+macro_rules! dyn_compare_scalar {
+ ($LEFT: expr, $RIGHT: expr, $OP: ident) => {{
+ let right = $RIGHT.try_into().map_err(|_| {
Review comment:
I just hadn't yet updated where $RIGHT is used in all the match arms to
use right instead
--
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]