@@ -70,13 +70,14 @@ use kernels::{
70
70
use kernels_arrow:: {
71
71
add_decimal_dyn_scalar, add_dyn_decimal, add_dyn_temporal, add_dyn_temporal_scalar,
72
72
divide_decimal_dyn_scalar, divide_dyn_opt_decimal, is_distinct_from,
73
- is_distinct_from_bool, is_distinct_from_decimal, is_distinct_from_f32,
74
- is_distinct_from_f64, is_distinct_from_null, is_distinct_from_utf8,
75
- is_not_distinct_from, is_not_distinct_from_bool, is_not_distinct_from_decimal,
76
- is_not_distinct_from_f32, is_not_distinct_from_f64, is_not_distinct_from_null,
77
- is_not_distinct_from_utf8, modulus_decimal_dyn_scalar, modulus_dyn_decimal,
78
- multiply_decimal_dyn_scalar, multiply_dyn_decimal, subtract_decimal_dyn_scalar,
79
- subtract_dyn_decimal, subtract_dyn_temporal, subtract_dyn_temporal_scalar,
73
+ is_distinct_from_binary, is_distinct_from_bool, is_distinct_from_decimal,
74
+ is_distinct_from_f32, is_distinct_from_f64, is_distinct_from_null,
75
+ is_distinct_from_utf8, is_not_distinct_from, is_not_distinct_from_binary,
76
+ is_not_distinct_from_bool, is_not_distinct_from_decimal, is_not_distinct_from_f32,
77
+ is_not_distinct_from_f64, is_not_distinct_from_null, is_not_distinct_from_utf8,
78
+ modulus_decimal_dyn_scalar, modulus_dyn_decimal, multiply_decimal_dyn_scalar,
79
+ multiply_dyn_decimal, subtract_decimal_dyn_scalar, subtract_dyn_decimal,
80
+ subtract_dyn_temporal, subtract_dyn_temporal_scalar,
80
81
} ;
81
82
82
83
use arrow:: datatypes:: { DataType , Schema , TimeUnit } ;
@@ -245,6 +246,21 @@ macro_rules! compute_utf8_op {
245
246
} } ;
246
247
}
247
248
249
+ /// Invoke a compute kernel on a pair of binary data arrays
250
+ macro_rules! compute_binary_op {
251
+ ( $LEFT: expr, $RIGHT: expr, $OP: ident, $DT: ident) => { {
252
+ let ll = $LEFT
253
+ . as_any( )
254
+ . downcast_ref:: <$DT>( )
255
+ . expect( "compute_op failed to downcast left side array" ) ;
256
+ let rr = $RIGHT
257
+ . as_any( )
258
+ . downcast_ref:: <$DT>( )
259
+ . expect( "compute_op failed to downcast right side array" ) ;
260
+ Ok ( Arc :: new( paste:: expr! { [ <$OP _binary>] } ( & ll, & rr) ?) )
261
+ } } ;
262
+ }
263
+
248
264
/// Invoke a compute kernel on a data array and a scalar value
249
265
macro_rules! compute_utf8_op_scalar {
250
266
( $LEFT: expr, $RIGHT: expr, $OP: ident, $DT: ident, $OP_TYPE: expr) => { {
@@ -510,7 +526,10 @@ macro_rules! binary_array_op {
510
526
DataType :: Float32 => compute_f32_op!( $LEFT, $RIGHT, $OP, Float32Array ) ,
511
527
DataType :: Float64 => compute_f64_op!( $LEFT, $RIGHT, $OP, Float64Array ) ,
512
528
DataType :: Utf8 => compute_utf8_op!( $LEFT, $RIGHT, $OP, StringArray ) ,
529
+ DataType :: Binary => compute_binary_op!( $LEFT, $RIGHT, $OP, BinaryArray ) ,
530
+ DataType :: LargeBinary => compute_binary_op!( $LEFT, $RIGHT, $OP, LargeBinaryArray ) ,
513
531
DataType :: LargeUtf8 => compute_utf8_op!( $LEFT, $RIGHT, $OP, LargeStringArray ) ,
532
+
514
533
DataType :: Timestamp ( TimeUnit :: Nanosecond , _) => {
515
534
compute_op!( $LEFT, $RIGHT, $OP, TimestampNanosecondArray )
516
535
}
0 commit comments