@@ -31,7 +31,7 @@ use datafusion_common::{exec_err, internal_err, plan_err};
3131
3232use std:: sync:: Arc ;
3333
34- /// Downcasts $LEFT and $RIGHT to $ARRAY_TYPE and then calls $KERNEL($LEFT, $RIGHT)
34+
3535macro_rules! call_kernel {
3636 ( $LEFT: expr, $RIGHT: expr, $KERNEL: expr, $ARRAY_TYPE: ident) => { {
3737 let left = $LEFT. as_any( ) . downcast_ref:: <$ARRAY_TYPE>( ) . unwrap( ) ;
@@ -41,8 +41,6 @@ macro_rules! call_kernel {
4141 } } ;
4242}
4343
44- /// Creates a $FUNC(left: ArrayRef, right: ArrayRef) that
45- /// downcasts left / right to the appropriate integral type and calls the kernel
4644macro_rules! create_left_integral_dyn_kernel {
4745 ( $FUNC: ident, $KERNEL: ident) => {
4846 pub ( crate ) fn $FUNC( left: ArrayRef , right: ArrayRef ) -> Result <ArrayRef > {
@@ -87,7 +85,7 @@ create_left_integral_dyn_kernel!(bitwise_and_dyn, bitwise_and);
8785create_left_integral_dyn_kernel ! ( bitwise_shift_right_dyn, bitwise_shift_right) ;
8886create_left_integral_dyn_kernel ! ( bitwise_shift_left_dyn, bitwise_shift_left) ;
8987
90- /// Downcasts $LEFT as $ARRAY_TYPE and $RIGHT as TYPE and calls $KERNEL($LEFT, $RIGHT)
88+
9189macro_rules! call_scalar_kernel {
9290 ( $LEFT: expr, $RIGHT: expr, $KERNEL: ident, $ARRAY_TYPE: ident, $TYPE: ty) => { {
9391 let len = $LEFT. len( ) ;
@@ -103,8 +101,6 @@ macro_rules! call_scalar_kernel {
103101 } } ;
104102}
105103
106- /// Creates a $FUNC(left: ArrayRef, right: ScalarValue) that
107- /// downcasts left / right to the appropriate integral type and calls the kernel
108104macro_rules! create_left_integral_dyn_scalar_kernel {
109105 ( $FUNC: ident, $KERNEL: ident) => {
110106 pub ( crate ) fn $FUNC(
@@ -213,6 +209,15 @@ pub(crate) fn regex_match_dyn(
213209 DataType :: LargeUtf8 => {
214210 regexp_is_match_flag ! ( left, right, LargeStringArray , not_match, flag)
215211 }
212+ DataType :: Dictionary ( _, _) => {
213+ let dict = left. as_any_dictionary ( ) ;
214+ let unpacked_left = arrow:: compute:: kernels:: take:: take (
215+ dict. values ( ) . as_ref ( ) ,
216+ dict. keys ( ) ,
217+ None ,
218+ ) ?;
219+ regex_match_dyn ( & unpacked_left, right, not_match, flag)
220+ }
216221 other => internal_err ! (
217222 "Data type {} not supported for regex_match_dyn on string array" ,
218223 other
0 commit comments