tustvold commented on code in PR #2591:
URL: https://github.com/apache/arrow-rs/pull/2591#discussion_r956485026
##########
arrow/src/compute/kernels/comparison.rs:
##########
@@ -315,6 +320,42 @@ pub fn like_utf8_scalar<OffsetSize: OffsetSizeTrait>(
Ok(BooleanArray::from(data))
}
+/// Perform SQL `left LIKE right` operation on [`StringArray`] /
+/// [`LargeStringArray`] and a scalar.
+///
+/// See the documentation on [`like_utf8`] for more details.
+pub fn like_utf8_scalar<OffsetSize: OffsetSizeTrait>(
+ left: &GenericStringArray<OffsetSize>,
+ right: &str,
+) -> Result<BooleanArray> {
+ like_scalar(left, right)
+}
+
+/// Perform SQL `left LIKE right` operation on [`DictionaryArray`] with values
+/// [`StringArray`]/[`LargeStringArray`] and a scalar.
+///
+/// See the documentation on [`like_utf8`] for more details.
+pub fn like_dict_scalar<K: ArrowNumericType>(
+ left: &DictionaryArray<K>,
+ right: &str,
+) -> Result<BooleanArray> {
+ match left.value_type() {
+ DataType::Utf8 => {
+ let left =
left.downcast_dict::<GenericStringArray<i32>>().unwrap();
+ like_scalar(left, right)
Review Comment:
Lets do it as a follow up
--
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]