alamb commented on code in PR #6376: URL: https://github.com/apache/arrow-rs/pull/6376#discussion_r1765771364
########## arrow-string/src/regexp.rs: ########## @@ -35,16 +38,64 @@ use std::sync::Arc; /// special search modes, such as case insensitive and multi-line mode. /// See the documentation [here](https://docs.rs/regex/1.5.4/regex/#grouping-and-flags) /// for more information. +#[deprecated(since = "54.0.0", note = "please use `regex_is_match` instead")] pub fn regexp_is_match_utf8<OffsetSize: OffsetSizeTrait>( array: &GenericStringArray<OffsetSize>, regex_array: &GenericStringArray<OffsetSize>, flags_array: Option<&GenericStringArray<OffsetSize>>, ) -> Result<BooleanArray, ArrowError> { + regexp_is_match(array, regex_array, flags_array) +} + +/// Return BooleanArray indicating which strings in an array match an array of +/// regular expressions. +/// +/// This is equivalent to the SQL `array ~ regex_array`, supporting +/// [`StringArray`] / [`LargeStringArray`] / [`StringViewArray`]. +/// +/// If `regex_array` element has an empty value, the corresponding result value is always true. +/// +/// `flags_array` are optional [`StringArray`] / [`LargeStringArray`] / [`StringViewArray`] flag, +/// which allow special search modes, such as case-insensitive and multi-line mode. +/// See the documentation [here](https://docs.rs/regex/1.5.4/regex/#grouping-and-flags) +/// for more information. +/// +/// # See Also +/// * [`regexp_is_match_scalar`] for matching a single regular expression against an array of strings +/// * [`regexp_match`] for extracting groups from a string array based on a regular expression +/// +/// # Example Review Comment: I added an example to help the migration  ########## arrow-string/src/regexp.rs: ########## @@ -35,16 +38,64 @@ use std::sync::Arc; /// special search modes, such as case insensitive and multi-line mode. /// See the documentation [here](https://docs.rs/regex/1.5.4/regex/#grouping-and-flags) /// for more information. +#[deprecated(since = "54.0.0", note = "please use `regex_is_match` instead")] pub fn regexp_is_match_utf8<OffsetSize: OffsetSizeTrait>( array: &GenericStringArray<OffsetSize>, regex_array: &GenericStringArray<OffsetSize>, flags_array: Option<&GenericStringArray<OffsetSize>>, ) -> Result<BooleanArray, ArrowError> { + regexp_is_match(array, regex_array, flags_array) Review Comment: I switched the implementation to just call the new function to avoid duplication -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org