From a501fa21c2fd01acf1a120594ecf0eaf13a48799 Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Fri, 25 Nov 2022 12:44:05 -0800 Subject: [PATCH 1/3] Add dictionary suppport to like, ilike, nlike, nilike kernels --- arrow/src/compute/kernels/comparison.rs | 235 +++++++++++++++++++++++- 1 file changed, 231 insertions(+), 4 deletions(-) diff --git a/arrow/src/compute/kernels/comparison.rs b/arrow/src/compute/kernels/comparison.rs index 7423b13bc07c..635fa5332830 100644 --- a/arrow/src/compute/kernels/comparison.rs +++ b/arrow/src/compute/kernels/comparison.rs @@ -140,14 +140,13 @@ fn is_like_pattern(c: char) -> bool { /// Evaluate regex `op(left)` matching `right` on [`StringArray`] / [`LargeStringArray`] /// /// If `negate_regex` is true, the regex expression will be negated. (for example, with `not like`) -fn regex_like( - left: &GenericStringArray, - right: &GenericStringArray, +fn regex_like<'a, S: ArrayAccessor, F>( + left: S, + right: S, negate_regex: bool, op: F, ) -> Result where - OffsetSize: OffsetSizeTrait, F: Fn(&str) -> Result, { let mut map = HashMap::new(); @@ -227,6 +226,48 @@ pub fn like_utf8( }) } +/// Perform SQL `left LIKE right` operation on on [`DictionaryArray`] with values +/// [`StringArray`]/[`LargeStringArray`]. +/// +/// See the documentation on [`like_utf8`] for more details. +pub fn like_dict( + left: &DictionaryArray, + right: &DictionaryArray, +) -> Result { + match (left.value_type(), right.value_type()) { + (DataType::Utf8, DataType::Utf8) => { + let left = left.downcast_dict::>().unwrap(); + let right = right.downcast_dict::>().unwrap(); + + regex_like(left, right, false, |re_pattern| { + Regex::new(&format!("^{}$", re_pattern)).map_err(|e| { + ArrowError::ComputeError(format!( + "Unable to build regex from LIKE pattern: {}", + e + )) + }) + }) + } + (DataType::LargeUtf8, DataType::LargeUtf8) => { + let left = left.downcast_dict::>().unwrap(); + let right = right.downcast_dict::>().unwrap(); + + regex_like(left, right, false, |re_pattern| { + Regex::new(&format!("^{}$", re_pattern)).map_err(|e| { + ArrowError::ComputeError(format!( + "Unable to build regex from LIKE pattern: {}", + e + )) + }) + }) + } + _ => Err(ArrowError::ComputeError( + "like_dict only supports DictionaryArray with Utf8 or LargeUtf8 values" + .to_string(), + )), + } +} + #[inline] fn like_scalar_op<'a, F: Fn(bool) -> bool, L: ArrayAccessor>( left: L, @@ -402,6 +443,48 @@ pub fn nlike_utf8( }) } +/// Perform SQL `left NOT LIKE right` operation on on [`DictionaryArray`] with values +/// [`StringArray`]/[`LargeStringArray`]. +/// +/// See the documentation on [`like_utf8`] for more details. +pub fn nlike_dict( + left: &DictionaryArray, + right: &DictionaryArray, +) -> Result { + match (left.value_type(), right.value_type()) { + (DataType::Utf8, DataType::Utf8) => { + let left = left.downcast_dict::>().unwrap(); + let right = right.downcast_dict::>().unwrap(); + + regex_like(left, right, true, |re_pattern| { + Regex::new(&format!("^{}$", re_pattern)).map_err(|e| { + ArrowError::ComputeError(format!( + "Unable to build regex from LIKE pattern: {}", + e + )) + }) + }) + } + (DataType::LargeUtf8, DataType::LargeUtf8) => { + let left = left.downcast_dict::>().unwrap(); + let right = right.downcast_dict::>().unwrap(); + + regex_like(left, right, true, |re_pattern| { + Regex::new(&format!("^{}$", re_pattern)).map_err(|e| { + ArrowError::ComputeError(format!( + "Unable to build regex from LIKE pattern: {}", + e + )) + }) + }) + } + _ => Err(ArrowError::ComputeError( + "nlike_dict only supports DictionaryArray with Utf8 or LargeUtf8 values" + .to_string(), + )), + } +} + #[inline] fn nlike_scalar<'a, L: ArrayAccessor>( left: L, @@ -464,6 +547,48 @@ pub fn ilike_utf8( }) } +/// Perform SQL `left ILIKE right` operation on on [`DictionaryArray`] with values +/// [`StringArray`]/[`LargeStringArray`]. +/// +/// See the documentation on [`like_utf8`] for more details. +pub fn ilike_dict( + left: &DictionaryArray, + right: &DictionaryArray, +) -> Result { + match (left.value_type(), right.value_type()) { + (DataType::Utf8, DataType::Utf8) => { + let left = left.downcast_dict::>().unwrap(); + let right = right.downcast_dict::>().unwrap(); + + regex_like(left, right, false, |re_pattern| { + Regex::new(&format!("(?i)^{}$", re_pattern)).map_err(|e| { + ArrowError::ComputeError(format!( + "Unable to build regex from ILIKE pattern: {}", + e + )) + }) + }) + } + (DataType::LargeUtf8, DataType::LargeUtf8) => { + let left = left.downcast_dict::>().unwrap(); + let right = right.downcast_dict::>().unwrap(); + + regex_like(left, right, false, |re_pattern| { + Regex::new(&format!("(?i)^{}$", re_pattern)).map_err(|e| { + ArrowError::ComputeError(format!( + "Unable to build regex from ILIKE pattern: {}", + e + )) + }) + }) + } + _ => Err(ArrowError::ComputeError( + "ilike_dict only supports DictionaryArray with Utf8 or LargeUtf8 values" + .to_string(), + )), + } +} + #[inline] fn ilike_scalar<'a, L: ArrayAccessor>( left: L, @@ -610,6 +735,48 @@ pub fn nilike_utf8( }) } +/// Perform SQL `left NOT ILIKE right` operation on on [`DictionaryArray`] with values +/// [`StringArray`]/[`LargeStringArray`]. +/// +/// See the documentation on [`like_utf8`] for more details. +pub fn nilike_dict( + left: &DictionaryArray, + right: &DictionaryArray, +) -> Result { + match (left.value_type(), right.value_type()) { + (DataType::Utf8, DataType::Utf8) => { + let left = left.downcast_dict::>().unwrap(); + let right = right.downcast_dict::>().unwrap(); + + regex_like(left, right, true, |re_pattern| { + Regex::new(&format!("(?i)^{}$", re_pattern)).map_err(|e| { + ArrowError::ComputeError(format!( + "Unable to build regex from ILIKE pattern: {}", + e + )) + }) + }) + } + (DataType::LargeUtf8, DataType::LargeUtf8) => { + let left = left.downcast_dict::>().unwrap(); + let right = right.downcast_dict::>().unwrap(); + + regex_like(left, right, true, |re_pattern| { + Regex::new(&format!("(?i)^{}$", re_pattern)).map_err(|e| { + ArrowError::ComputeError(format!( + "Unable to build regex from ILIKE pattern: {}", + e + )) + }) + }) + } + _ => Err(ArrowError::ComputeError( + "nilike_dict only supports DictionaryArray with Utf8 or LargeUtf8 values" + .to_string(), + )), + } +} + #[inline] fn nilike_scalar<'a, L: ArrayAccessor>( left: L, @@ -4352,6 +4519,23 @@ mod tests { }; } + macro_rules! test_dict_utf8 { + ($test_name:ident, $left:expr, $right:expr, $op:expr, $expected:expr) => { + #[test] + fn $test_name() { + let left: DictionaryArray = $left.into_iter().collect(); + let right: DictionaryArray = $right.into_iter().collect(); + let res = $op(&left, &right).unwrap(); + let expected = $expected; + assert_eq!(expected.len(), res.len()); + for i in 0..res.len() { + let v = res.value(i); + assert_eq!(v, expected[i]); + } + } + }; + } + #[test] fn test_utf8_eq_scalar_on_slice() { let a = StringArray::from( @@ -4496,6 +4680,14 @@ mod tests { vec![true, true, true, false, false, true, false, false] ); + test_dict_utf8!( + test_utf8_array_like_dict, + vec!["arrow", "arrow", "arrow", "arrow", "arrow", "arrows", "arrow", "arrow"], + vec!["arrow", "ar%", "%ro%", "foo", "arr", "arrow_", "arrow_", ".*"], + like_dict, + vec![true, true, true, false, false, true, false, false] + ); + test_utf8_scalar!( test_utf8_array_like_scalar_escape_testing, vec!["varchar(255)", "int(255)", "varchar", "int"], @@ -4664,6 +4856,14 @@ mod tests { vec![true] ); + test_dict_utf8!( + test_utf8_scalar_ilike_regex_dict, + vec!["%%%"], + vec![r#"\%_\%"#], + ilike_dict, + vec![true] + ); + #[test] fn test_replace_like_wildcards() { let a_eq = "_%"; @@ -4714,6 +4914,15 @@ mod tests { nlike_utf8, vec![false, false, false, true, true, false, true] ); + + test_dict_utf8!( + test_utf8_array_nlike_dict, + vec!["arrow", "arrow", "arrow", "arrow", "arrow", "arrows", "arrow"], + vec!["arrow", "ar%", "%ro%", "foo", "arr", "arrow_", "arrow_"], + nlike_dict, + vec![false, false, false, true, true, false, true] + ); + test_utf8_scalar!( test_utf8_array_nlike_escape_testing, vec!["varchar(255)", "int(255)", "varchar", "int"], @@ -4784,6 +4993,15 @@ mod tests { ilike_utf8, vec![true, true, true, false, false, true, false] ); + + test_dict_utf8!( + test_utf8_array_ilike_dict, + vec!["arrow", "arrow", "ARROW", "arrow", "ARROW", "ARROWS", "arROw"], + vec!["arrow", "ar%", "%ro%", "foo", "ar%r", "arrow_", "arrow_"], + ilike_dict, + vec![true, true, true, false, false, true, false] + ); + test_utf8_scalar!( ilike_utf8_scalar_escape_testing, vec!["varchar(255)", "int(255)", "varchar", "int"], @@ -4838,6 +5056,15 @@ mod tests { nilike_utf8, vec![false, false, false, true, true, false, true] ); + + test_dict_utf8!( + test_utf8_array_nilike_dict, + vec!["arrow", "arrow", "ARROW", "arrow", "ARROW", "ARROWS", "arROw"], + vec!["arrow", "ar%", "%ro%", "foo", "ar%r", "arrow_", "arrow_"], + nilike_dict, + vec![false, false, false, true, true, false, true] + ); + test_utf8_scalar!( nilike_utf8_scalar_escape_testing, vec!["varchar(255)", "int(255)", "varchar", "int"], From dbc08d3461875c0adbf77f0326f26895372730e3 Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Sat, 26 Nov 2022 11:24:33 -0800 Subject: [PATCH 2/3] Add _dyn kernels for dictionary support --- arrow/src/compute/kernels/comparison.rs | 159 ++++++++++++++++++++++-- 1 file changed, 150 insertions(+), 9 deletions(-) diff --git a/arrow/src/compute/kernels/comparison.rs b/arrow/src/compute/kernels/comparison.rs index ef33f6d1b881..ad7372a2dd8a 100644 --- a/arrow/src/compute/kernels/comparison.rs +++ b/arrow/src/compute/kernels/comparison.rs @@ -226,11 +226,47 @@ pub fn like_utf8( }) } +/// Perform SQL `left LIKE right` operation on [`StringArray`] / +/// [`LargeStringArray`], or [`DictionaryArray`] with values +/// [`StringArray`]/[`LargeStringArray`]. +/// +/// See the documentation on [`like_utf8`] for more details. +pub fn like_dyn(left: &dyn Array, right: &dyn Array) -> Result { + match (left.data_type(), right.data_type()) { + (DataType::Utf8, DataType::Utf8) => { + let left = as_string_array(left); + let right = as_string_array(right); + like_utf8(left, right) + } + (DataType::LargeUtf8, DataType::LargeUtf8) => { + let left = as_largestring_array(left); + let right = as_largestring_array(right); + like_utf8(left, right) + } + (DataType::Dictionary(_, _), DataType::Dictionary(_, _)) => { + downcast_dictionary_array!( + left => { + let right = as_dictionary_array(right); + like_dict(left, right) + } + t => Err(ArrowError::ComputeError(format!( + "Should be DictionaryArray but got: {}", t + ))) + ) + } + _ => { + Err(ArrowError::ComputeError( + "like_dyn only supports Utf8, LargeUtf8 or DictionaryArray with Utf8 or LargeUtf8 values".to_string(), + )) + } + } +} + /// Perform SQL `left LIKE right` operation on on [`DictionaryArray`] with values /// [`StringArray`]/[`LargeStringArray`]. /// /// See the documentation on [`like_utf8`] for more details. -pub fn like_dict( +fn like_dict( left: &DictionaryArray, right: &DictionaryArray, ) -> Result { @@ -447,7 +483,42 @@ pub fn nlike_utf8( /// [`StringArray`]/[`LargeStringArray`]. /// /// See the documentation on [`like_utf8`] for more details. -pub fn nlike_dict( +pub fn nlike_dyn(left: &dyn Array, right: &dyn Array) -> Result { + match (left.data_type(), right.data_type()) { + (DataType::Utf8, DataType::Utf8) => { + let left = as_string_array(left); + let right = as_string_array(right); + nlike_utf8(left, right) + } + (DataType::LargeUtf8, DataType::LargeUtf8) => { + let left = as_largestring_array(left); + let right = as_largestring_array(right); + nlike_utf8(left, right) + } + (DataType::Dictionary(_, _), DataType::Dictionary(_, _)) => { + downcast_dictionary_array!( + left => { + let right = as_dictionary_array(right); + nlike_dict(left, right) + } + t => Err(ArrowError::ComputeError(format!( + "Should be DictionaryArray but got: {}", t + ))) + ) + } + _ => { + Err(ArrowError::ComputeError( + "nlike_dyn only supports Utf8, LargeUtf8 or DictionaryArray with Utf8 or LargeUtf8 values".to_string(), + )) + } + } +} + +/// Perform SQL `left NOT LIKE right` operation on on [`DictionaryArray`] with values +/// [`StringArray`]/[`LargeStringArray`]. +/// +/// See the documentation on [`like_utf8`] for more details. +fn nlike_dict( left: &DictionaryArray, right: &DictionaryArray, ) -> Result { @@ -584,7 +655,42 @@ pub fn ilike_utf8( /// [`StringArray`]/[`LargeStringArray`]. /// /// See the documentation on [`like_utf8`] for more details. -pub fn ilike_dict( +pub fn ilike_dyn(left: &dyn Array, right: &dyn Array) -> Result { + match (left.data_type(), right.data_type()) { + (DataType::Utf8, DataType::Utf8) => { + let left = as_string_array(left); + let right = as_string_array(right); + ilike_utf8(left, right) + } + (DataType::LargeUtf8, DataType::LargeUtf8) => { + let left = as_largestring_array(left); + let right = as_largestring_array(right); + ilike_utf8(left, right) + } + (DataType::Dictionary(_, _), DataType::Dictionary(_, _)) => { + downcast_dictionary_array!( + left => { + let right = as_dictionary_array(right); + ilike_dict(left, right) + } + t => Err(ArrowError::ComputeError(format!( + "Should be DictionaryArray but got: {}", t + ))) + ) + } + _ => { + Err(ArrowError::ComputeError( + "ilike_dyn only supports Utf8, LargeUtf8 or DictionaryArray with Utf8 or LargeUtf8 values".to_string(), + )) + } + } +} + +/// Perform SQL `left ILIKE right` operation on on [`DictionaryArray`] with values +/// [`StringArray`]/[`LargeStringArray`]. +/// +/// See the documentation on [`like_utf8`] for more details. +fn ilike_dict( left: &DictionaryArray, right: &DictionaryArray, ) -> Result { @@ -805,7 +911,42 @@ pub fn nilike_utf8( /// [`StringArray`]/[`LargeStringArray`]. /// /// See the documentation on [`like_utf8`] for more details. -pub fn nilike_dict( +pub fn nilike_dyn(left: &dyn Array, right: &dyn Array) -> Result { + match (left.data_type(), right.data_type()) { + (DataType::Utf8, DataType::Utf8) => { + let left = as_string_array(left); + let right = as_string_array(right); + nilike_utf8(left, right) + } + (DataType::LargeUtf8, DataType::LargeUtf8) => { + let left = as_largestring_array(left); + let right = as_largestring_array(right); + nilike_utf8(left, right) + } + (DataType::Dictionary(_, _), DataType::Dictionary(_, _)) => { + downcast_dictionary_array!( + left => { + let right = as_dictionary_array(right); + nilike_dict(left, right) + } + t => Err(ArrowError::ComputeError(format!( + "Should be DictionaryArray but got: {}", t + ))) + ) + } + _ => { + Err(ArrowError::ComputeError( + "nilike_dyn only supports Utf8, LargeUtf8 or DictionaryArray with Utf8 or LargeUtf8 values".to_string(), + )) + } + } +} + +/// Perform SQL `left NOT ILIKE right` operation on on [`DictionaryArray`] with values +/// [`StringArray`]/[`LargeStringArray`]. +/// +/// See the documentation on [`like_utf8`] for more details. +fn nilike_dict( left: &DictionaryArray, right: &DictionaryArray, ) -> Result { @@ -4787,7 +4928,7 @@ mod tests { test_utf8_array_like_dict, vec!["arrow", "arrow", "arrow", "arrow", "arrow", "arrows", "arrow", "arrow"], vec!["arrow", "ar%", "%ro%", "foo", "arr", "arrow_", "arrow_", ".*"], - like_dict, + like_dyn, vec![true, true, true, false, false, true, false, false] ); @@ -4903,7 +5044,7 @@ mod tests { test_utf8_scalar_ilike_regex_dict, vec!["%%%"], vec![r#"\%_\%"#], - ilike_dict, + ilike_dyn, vec![true] ); @@ -4962,7 +5103,7 @@ mod tests { test_utf8_array_nlike_dict, vec!["arrow", "arrow", "arrow", "arrow", "arrow", "arrows", "arrow"], vec!["arrow", "ar%", "%ro%", "foo", "arr", "arrow_", "arrow_"], - nlike_dict, + nlike_dyn, vec![false, false, false, true, true, false, true] ); @@ -5057,7 +5198,7 @@ mod tests { test_utf8_array_ilike_dict, vec!["arrow", "arrow", "ARROW", "arrow", "ARROW", "ARROWS", "arROw"], vec!["arrow", "ar%", "%ro%", "foo", "ar%r", "arrow_", "arrow_"], - ilike_dict, + ilike_dyn, vec![true, true, true, false, false, true, false] ); @@ -5133,7 +5274,7 @@ mod tests { test_utf8_array_nilike_dict, vec!["arrow", "arrow", "ARROW", "arrow", "ARROW", "ARROWS", "arROw"], vec!["arrow", "ar%", "%ro%", "foo", "ar%r", "arrow_", "arrow_"], - nilike_dict, + nilike_dyn, vec![false, false, false, true, true, false, true] ); From 83bd333c22185d7c598a0f04a83aae078a6cdaec Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Sun, 27 Nov 2022 15:30:19 -0800 Subject: [PATCH 3/3] Gated by feature dyn_cmp_dict --- arrow/src/compute/kernels/comparison.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/arrow/src/compute/kernels/comparison.rs b/arrow/src/compute/kernels/comparison.rs index ad7372a2dd8a..4df17def39e3 100644 --- a/arrow/src/compute/kernels/comparison.rs +++ b/arrow/src/compute/kernels/comparison.rs @@ -243,6 +243,7 @@ pub fn like_dyn(left: &dyn Array, right: &dyn Array) -> Result { let right = as_largestring_array(right); like_utf8(left, right) } + #[cfg(feature = "dyn_cmp_dict")] (DataType::Dictionary(_, _), DataType::Dictionary(_, _)) => { downcast_dictionary_array!( left => { @@ -256,7 +257,7 @@ pub fn like_dyn(left: &dyn Array, right: &dyn Array) -> Result { } _ => { Err(ArrowError::ComputeError( - "like_dyn only supports Utf8, LargeUtf8 or DictionaryArray with Utf8 or LargeUtf8 values".to_string(), + "like_dyn only supports Utf8, LargeUtf8 or DictionaryArray (with feature `dyn_cmp_dict`) with Utf8 or LargeUtf8 values".to_string(), )) } } @@ -266,6 +267,7 @@ pub fn like_dyn(left: &dyn Array, right: &dyn Array) -> Result { /// [`StringArray`]/[`LargeStringArray`]. /// /// See the documentation on [`like_utf8`] for more details. +#[cfg(feature = "dyn_cmp_dict")] fn like_dict( left: &DictionaryArray, right: &DictionaryArray, @@ -495,6 +497,7 @@ pub fn nlike_dyn(left: &dyn Array, right: &dyn Array) -> Result { let right = as_largestring_array(right); nlike_utf8(left, right) } + #[cfg(feature = "dyn_cmp_dict")] (DataType::Dictionary(_, _), DataType::Dictionary(_, _)) => { downcast_dictionary_array!( left => { @@ -508,7 +511,7 @@ pub fn nlike_dyn(left: &dyn Array, right: &dyn Array) -> Result { } _ => { Err(ArrowError::ComputeError( - "nlike_dyn only supports Utf8, LargeUtf8 or DictionaryArray with Utf8 or LargeUtf8 values".to_string(), + "nlike_dyn only supports Utf8, LargeUtf8 or DictionaryArray (with feature `dyn_cmp_dict`) with Utf8 or LargeUtf8 values".to_string(), )) } } @@ -518,6 +521,7 @@ pub fn nlike_dyn(left: &dyn Array, right: &dyn Array) -> Result { /// [`StringArray`]/[`LargeStringArray`]. /// /// See the documentation on [`like_utf8`] for more details. +#[cfg(feature = "dyn_cmp_dict")] fn nlike_dict( left: &DictionaryArray, right: &DictionaryArray, @@ -667,6 +671,7 @@ pub fn ilike_dyn(left: &dyn Array, right: &dyn Array) -> Result { let right = as_largestring_array(right); ilike_utf8(left, right) } + #[cfg(feature = "dyn_cmp_dict")] (DataType::Dictionary(_, _), DataType::Dictionary(_, _)) => { downcast_dictionary_array!( left => { @@ -680,7 +685,7 @@ pub fn ilike_dyn(left: &dyn Array, right: &dyn Array) -> Result { } _ => { Err(ArrowError::ComputeError( - "ilike_dyn only supports Utf8, LargeUtf8 or DictionaryArray with Utf8 or LargeUtf8 values".to_string(), + "ilike_dyn only supports Utf8, LargeUtf8 or DictionaryArray (with feature `dyn_cmp_dict`) with Utf8 or LargeUtf8 values".to_string(), )) } } @@ -690,6 +695,7 @@ pub fn ilike_dyn(left: &dyn Array, right: &dyn Array) -> Result { /// [`StringArray`]/[`LargeStringArray`]. /// /// See the documentation on [`like_utf8`] for more details. +#[cfg(feature = "dyn_cmp_dict")] fn ilike_dict( left: &DictionaryArray, right: &DictionaryArray, @@ -847,7 +853,7 @@ pub fn ilike_utf8_scalar_dyn(left: &dyn Array, right: &str) -> Result { Err(ArrowError::ComputeError( - "ilike_utf8_scalar_dyn only supports Utf8, LargeUtf8 or DictionaryArray with Utf8 or LargeUtf8 values".to_string(), + "ilike_utf8_scalar_dyn only supports Utf8, LargeUtf8 or DictionaryArray (with feature `dyn_cmp_dict`) with Utf8 or LargeUtf8 values".to_string(), )) } } @@ -923,6 +929,7 @@ pub fn nilike_dyn(left: &dyn Array, right: &dyn Array) -> Result { let right = as_largestring_array(right); nilike_utf8(left, right) } + #[cfg(feature = "dyn_cmp_dict")] (DataType::Dictionary(_, _), DataType::Dictionary(_, _)) => { downcast_dictionary_array!( left => { @@ -936,7 +943,7 @@ pub fn nilike_dyn(left: &dyn Array, right: &dyn Array) -> Result { } _ => { Err(ArrowError::ComputeError( - "nilike_dyn only supports Utf8, LargeUtf8 or DictionaryArray with Utf8 or LargeUtf8 values".to_string(), + "nilike_dyn only supports Utf8, LargeUtf8 or DictionaryArray (with feature `dyn_cmp_dict`) with Utf8 or LargeUtf8 values".to_string(), )) } } @@ -946,6 +953,7 @@ pub fn nilike_dyn(left: &dyn Array, right: &dyn Array) -> Result { /// [`StringArray`]/[`LargeStringArray`]. /// /// See the documentation on [`like_utf8`] for more details. +#[cfg(feature = "dyn_cmp_dict")] fn nilike_dict( left: &DictionaryArray, right: &DictionaryArray, @@ -4762,6 +4770,7 @@ mod tests { macro_rules! test_dict_utf8 { ($test_name:ident, $left:expr, $right:expr, $op:expr, $expected:expr) => { #[test] + #[cfg(feature = "dyn_cmp_dict")] fn $test_name() { let left: DictionaryArray = $left.into_iter().collect(); let right: DictionaryArray = $right.into_iter().collect();