viirya commented on code in PR #3502:
URL: https://github.com/apache/arrow-rs/pull/3502#discussion_r1068496667
##########
arrow-string/src/like.rs:
##########
@@ -533,6 +626,111 @@ where
Ok(BooleanArray::from(data))
}
+/// Perform SQL `STARTSWITH(left, right)` operation on [`StringArray`] /
[`LargeStringArray`].
+pub fn starts_with_utf8<OffsetSize: OffsetSizeTrait>(
+ left: &GenericStringArray<OffsetSize>,
+ right: &GenericStringArray<OffsetSize>,
+) -> Result<BooleanArray, ArrowError> {
+ starts_with(left, right)
+}
+
+#[inline]
+fn starts_with<'a, S: ArrayAccessor<Item = &'a str>>(
+ left: S,
+ right: S,
+) -> Result<BooleanArray, ArrowError> {
+ compare_op(left, right, |l, r| l.starts_with(r))
+}
+
+#[inline]
+fn starts_with_scalar<'a, L: ArrayAccessor<Item = &'a str>>(
+ left: L,
+ right: &str,
+) -> Result<BooleanArray, ArrowError> {
+ compare_op_scalar(left, |item| item.starts_with(right))
+}
+
+/// Perform SQL `STARTSWITH(left, right)` operation on [`StringArray`] /
+/// [`LargeStringArray`] and a scalar.
+///
+/// See the documentation on [`like_utf8`] for more details.
Review Comment:
`starts_with_utf8` doesn't have this `See ...`. Does
`starts_with_utf8_scalar` need it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]