Skip to content

Commit

Permalink
Hide _dict_scalar kernels behind _dyn kernels (#3202)
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya authored Nov 27, 2022
1 parent 0ef1848 commit 785d992
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions arrow/src/compute/kernels/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ pub fn like_utf8_scalar<OffsetSize: OffsetSizeTrait>(
/// [`StringArray`]/[`LargeStringArray`] and a scalar.
///
/// See the documentation on [`like_utf8`] for more details.
pub fn like_dict_scalar<K: ArrowNumericType>(
fn like_dict_scalar<K: ArrowNumericType>(
left: &DictionaryArray<K>,
right: &str,
) -> Result<BooleanArray> {
Expand Down Expand Up @@ -458,7 +458,7 @@ pub fn nlike_utf8_scalar<OffsetSize: OffsetSizeTrait>(
/// [`StringArray`]/[`LargeStringArray`] and a scalar.
///
/// See the documentation on [`like_utf8`] for more details.
pub fn nlike_dict_scalar<K: ArrowNumericType>(
fn nlike_dict_scalar<K: ArrowNumericType>(
left: &DictionaryArray<K>,
right: &str,
) -> Result<BooleanArray> {
Expand Down Expand Up @@ -637,7 +637,7 @@ pub fn ilike_utf8_scalar<OffsetSize: OffsetSizeTrait>(
/// [`StringArray`]/[`LargeStringArray`] and a scalar.
///
/// See the documentation on [`like_utf8`] for more details.
pub fn ilike_dict_scalar<K: ArrowNumericType>(
fn ilike_dict_scalar<K: ArrowNumericType>(
left: &DictionaryArray<K>,
right: &str,
) -> Result<BooleanArray> {
Expand Down Expand Up @@ -816,7 +816,7 @@ pub fn nilike_utf8_scalar<OffsetSize: OffsetSizeTrait>(
/// [`StringArray`]/[`LargeStringArray`] and a scalar.
///
/// See the documentation on [`like_utf8`] for more details.
pub fn nilike_dict_scalar<K: ArrowNumericType>(
fn nilike_dict_scalar<K: ArrowNumericType>(
left: &DictionaryArray<K>,
right: &str,
) -> Result<BooleanArray> {
Expand Down Expand Up @@ -6342,7 +6342,7 @@ mod tests {
let dict_arrayref = Arc::new(dict_array.clone()) as ArrayRef;

assert_eq!(
like_dict_scalar(&dict_array, "Air").unwrap(),
like_utf8_scalar_dyn(&dict_array, "Air").unwrap(),
BooleanArray::from(
vec![Some(false), Some(false), Some(false), Some(true), None, Some(true)]
),
Expand All @@ -6356,7 +6356,7 @@ mod tests {
);

assert_eq!(
like_dict_scalar(&dict_array, "Wa%").unwrap(),
like_utf8_scalar_dyn(&dict_array, "Wa%").unwrap(),
BooleanArray::from(
vec![Some(false), Some(false), Some(true), Some(false), None, Some(false)]
),
Expand All @@ -6370,7 +6370,7 @@ mod tests {
);

assert_eq!(
like_dict_scalar(&dict_array, "%r").unwrap(),
like_utf8_scalar_dyn(&dict_array, "%r").unwrap(),
BooleanArray::from(
vec![Some(false), Some(false), Some(true), Some(true), None, Some(true)]
),
Expand All @@ -6384,7 +6384,7 @@ mod tests {
);

assert_eq!(
like_dict_scalar(&dict_array, "%i%").unwrap(),
like_utf8_scalar_dyn(&dict_array, "%i%").unwrap(),
BooleanArray::from(
vec![Some(false), Some(true), Some(false), Some(true), None, Some(true)]
),
Expand All @@ -6398,7 +6398,7 @@ mod tests {
);

assert_eq!(
like_dict_scalar(&dict_array, "%a%r%").unwrap(),
like_utf8_scalar_dyn(&dict_array, "%a%r%").unwrap(),
BooleanArray::from(
vec![Some(true), Some(false), Some(true), Some(false), None, Some(false)]
),
Expand Down Expand Up @@ -6634,7 +6634,7 @@ mod tests {
let dict_arrayref = Arc::new(dict_array.clone()) as ArrayRef;

assert_eq!(
nlike_dict_scalar(&dict_array, "Air").unwrap(),
nlike_utf8_scalar_dyn(&dict_array, "Air").unwrap(),
BooleanArray::from(
vec![Some(true), Some(true), Some(true), Some(false), None, Some(false)]
),
Expand All @@ -6648,7 +6648,7 @@ mod tests {
);

assert_eq!(
nlike_dict_scalar(&dict_array, "Wa%").unwrap(),
nlike_utf8_scalar_dyn(&dict_array, "Wa%").unwrap(),
BooleanArray::from(
vec![Some(true), Some(true), Some(false), Some(true), None, Some(true)]
),
Expand All @@ -6662,7 +6662,7 @@ mod tests {
);

assert_eq!(
nlike_dict_scalar(&dict_array, "%r").unwrap(),
nlike_utf8_scalar_dyn(&dict_array, "%r").unwrap(),
BooleanArray::from(
vec![Some(true), Some(true), Some(false), Some(false), None, Some(false)]
),
Expand All @@ -6676,7 +6676,7 @@ mod tests {
);

assert_eq!(
nlike_dict_scalar(&dict_array, "%i%").unwrap(),
nlike_utf8_scalar_dyn(&dict_array, "%i%").unwrap(),
BooleanArray::from(
vec![Some(true), Some(false), Some(true), Some(false), None, Some(false)]
),
Expand All @@ -6690,7 +6690,7 @@ mod tests {
);

assert_eq!(
nlike_dict_scalar(&dict_array, "%a%r%").unwrap(),
nlike_utf8_scalar_dyn(&dict_array, "%a%r%").unwrap(),
BooleanArray::from(
vec![Some(false), Some(true), Some(false), Some(true), None, Some(true)]
),
Expand All @@ -6714,7 +6714,7 @@ mod tests {
let dict_arrayref = Arc::new(dict_array.clone()) as ArrayRef;

assert_eq!(
ilike_dict_scalar(&dict_array, "air").unwrap(),
ilike_utf8_scalar_dyn(&dict_array, "air").unwrap(),
BooleanArray::from(
vec![Some(false), Some(false), Some(false), Some(true), None, Some(true)]
),
Expand All @@ -6728,7 +6728,7 @@ mod tests {
);

assert_eq!(
ilike_dict_scalar(&dict_array, "wa%").unwrap(),
ilike_utf8_scalar_dyn(&dict_array, "wa%").unwrap(),
BooleanArray::from(
vec![Some(false), Some(false), Some(true), Some(false), None, Some(false)]
),
Expand All @@ -6742,7 +6742,7 @@ mod tests {
);

assert_eq!(
ilike_dict_scalar(&dict_array, "%R").unwrap(),
ilike_utf8_scalar_dyn(&dict_array, "%R").unwrap(),
BooleanArray::from(
vec![Some(false), Some(false), Some(true), Some(true), None, Some(true)]
),
Expand All @@ -6756,7 +6756,7 @@ mod tests {
);

assert_eq!(
ilike_dict_scalar(&dict_array, "%I%").unwrap(),
ilike_utf8_scalar_dyn(&dict_array, "%I%").unwrap(),
BooleanArray::from(
vec![Some(false), Some(true), Some(false), Some(true), None, Some(true)]
),
Expand All @@ -6770,7 +6770,7 @@ mod tests {
);

assert_eq!(
ilike_dict_scalar(&dict_array, "%A%r%").unwrap(),
ilike_utf8_scalar_dyn(&dict_array, "%A%r%").unwrap(),
BooleanArray::from(
vec![Some(true), Some(false), Some(true), Some(true), None, Some(true)]
),
Expand All @@ -6794,7 +6794,7 @@ mod tests {
let dict_arrayref = Arc::new(dict_array.clone()) as ArrayRef;

assert_eq!(
nilike_dict_scalar(&dict_array, "air").unwrap(),
nilike_utf8_scalar_dyn(&dict_array, "air").unwrap(),
BooleanArray::from(
vec![Some(true), Some(true), Some(true), Some(false), None, Some(false)]
),
Expand All @@ -6808,7 +6808,7 @@ mod tests {
);

assert_eq!(
nilike_dict_scalar(&dict_array, "wa%").unwrap(),
nilike_utf8_scalar_dyn(&dict_array, "wa%").unwrap(),
BooleanArray::from(
vec![Some(true), Some(true), Some(false), Some(true), None, Some(true)]
),
Expand All @@ -6822,7 +6822,7 @@ mod tests {
);

assert_eq!(
nilike_dict_scalar(&dict_array, "%R").unwrap(),
nilike_utf8_scalar_dyn(&dict_array, "%R").unwrap(),
BooleanArray::from(
vec![Some(true), Some(true), Some(false), Some(false), None, Some(false)]
),
Expand All @@ -6836,7 +6836,7 @@ mod tests {
);

assert_eq!(
nilike_dict_scalar(&dict_array, "%I%").unwrap(),
nilike_utf8_scalar_dyn(&dict_array, "%I%").unwrap(),
BooleanArray::from(
vec![Some(true), Some(false), Some(true), Some(false), None, Some(false)]
),
Expand All @@ -6850,7 +6850,7 @@ mod tests {
);

assert_eq!(
nilike_dict_scalar(&dict_array, "%A%r%").unwrap(),
nilike_utf8_scalar_dyn(&dict_array, "%A%r%").unwrap(),
BooleanArray::from(
vec![Some(false), Some(true), Some(false), Some(false), None, Some(false)]
),
Expand Down

0 comments on commit 785d992

Please sign in to comment.