devanbenz commented on code in PR #12201:
URL: https://github.com/apache/datafusion/pull/12201#discussion_r1733699400
##########
datafusion/functions/src/regex/regexpreplace.rs:
##########
@@ -496,7 +499,67 @@ pub fn specialize_regexp_replace<T: OffsetSizeTrait>(
.iter()
.map(|arg| arg.clone().into_array(inferred_length))
.collect::<Result<Vec<_>>>()?;
- regexp_replace::<T>(&args)
+
+ match args[0].data_type() {
+ DataType::Utf8View => {
+ let string_array = args[0].as_string_view();
+ let pattern_array = args[1].as_string::<i32>();
+ let replacement_array = args[2].as_string::<i32>();
+ let regexp_replace_result = regexp_replace::<i32, _, _>(
+ string_array,
+ pattern_array,
+ replacement_array,
+ args.get(3),
+ )?;
+
+ if regexp_replace_result.data_type() == &DataType::Utf8 {
Review Comment:
There may be a better way to do this but I'm unsure how.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]