From 7e34b7df1c3cdd49c36f18e119ea1a8b0e78ecd8 Mon Sep 17 00:00:00 2001 From: Tai Le Manh Date: Sun, 17 Nov 2024 08:46:12 +0700 Subject: [PATCH] Remove redundant implementation of StringArrayType Signed-off-by: Tai Le Manh --- arrow-string/src/like.rs | 38 ++++---------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/arrow-string/src/like.rs b/arrow-string/src/like.rs index 0a5aa77dbb9..e30e09146c6 100644 --- a/arrow-string/src/like.rs +++ b/arrow-string/src/like.rs @@ -18,13 +18,16 @@ //! Provide SQL's LIKE operators for Arrow's string arrays use crate::predicate::Predicate; + use arrow_array::cast::AsArray; use arrow_array::*; use arrow_schema::*; use arrow_select::take::take; -use iterator::ArrayIter; + use std::sync::Arc; +pub use arrow_array::StringArrayType; + #[derive(Debug)] enum Op { Like(bool), @@ -150,39 +153,6 @@ fn like_op(op: Op, lhs: &dyn Datum, rhs: &dyn Datum) -> Result: ArrayAccessor + Sized { - /// Returns true if all data within this string array is ASCII - fn is_ascii(&self) -> bool; - /// Constructs a new iterator - fn iter(&self) -> ArrayIter; -} - -impl<'a, O: OffsetSizeTrait> StringArrayType<'a> for &'a GenericStringArray { - fn is_ascii(&self) -> bool { - GenericStringArray::::is_ascii(self) - } - - fn iter(&self) -> ArrayIter { - GenericStringArray::::iter(self) - } -} -impl<'a> StringArrayType<'a> for &'a StringViewArray { - fn is_ascii(&self) -> bool { - StringViewArray::is_ascii(self) - } - - fn iter(&self) -> ArrayIter { - StringViewArray::iter(self) - } -} - fn apply<'a, T: StringArrayType<'a> + 'a>( op: Op, l: T,