alamb commented on code in PR #3008:
URL: https://github.com/apache/arrow-datafusion/pull/3008#discussion_r934805470
##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -816,33 +889,6 @@ macro_rules! binary_string_array_op {
}};
}
-/// Invoke a compute kernel on a pair of arrays
-/// The binary_primitive_array_op macro only evaluates for primitive types
-/// like integers and floats.
-macro_rules! binary_primitive_array_op {
Review Comment:
The point of the PR was to remove this macro
##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -83,13 +82,87 @@ macro_rules! make_dyn_comp_op {
};
}
+/// create a `dyn_op` function that call the underlying arrow
+/// arithmetic kernel if the type is supported, and translates
+/// ArrowError to DataFusionError
+macro_rules! make_dyn_arithmetic_op {
+ ($OP:tt) => {
+ paste::paste! {
+ /// wrapper over arrow compute kernel that maps Error types and
+ /// patches missing support in arrow
+ fn [<$OP _dyn>] (left: &dyn Array, right: &dyn Array) ->
Result<ArrayRef> {
+ match (left.data_type(), right.data_type()) {
+ // Call `op_decimal` (e.g. `eq_decimal) until
+ // arrow has native support
+ // https://github.com/apache/arrow-rs/issues/1200
+ (DataType::Decimal(_, _), DataType::Decimal(_, _)) => {
Review Comment:
I will try and do https://github.com/apache/arrow-rs/issues/1200 so we can
remove these wrappers
--
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]