mbutrovich commented on code in PR #17195:
URL: https://github.com/apache/datafusion/pull/17195#discussion_r2282955561


##########
datafusion/functions/src/regex/regexpreplace.rs:
##########
@@ -94,14 +98,30 @@ impl Default for RegexpReplaceFunc {
 
 impl RegexpReplaceFunc {
     pub fn new() -> Self {
-        use DataType::*;
+        use TypeSignature::*;
+        use TypeSignatureClass::*;
         Self {
             signature: Signature::one_of(
                 vec![
-                    TypeSignature::Exact(vec![Utf8, Utf8, Utf8]),

Review Comment:
   Actually, if I reorder them into the precedence that I want...
   ```
               signature: Signature::one_of(
                   vec![
                       Exact(vec![Utf8View, Utf8View, Utf8View]),
                       Exact(vec![LargeUtf8, LargeUtf8, LargeUtf8]),
                       Exact(vec![Utf8, Utf8, Utf8]),
                       Exact(vec![Utf8View, Utf8View, Utf8View, Utf8View]),
                       Exact(vec![LargeUtf8, LargeUtf8, LargeUtf8, LargeUtf8]),
                       Exact(vec![Utf8, Utf8, Utf8, Utf8]),
                   ],
                   Volatility::Immutable,
               ),
   ```
   I get...
   ```
   External error: 1 errors in file 
/Users/matt/git/datafusion/datafusion/sqllogictest/test_files/string/string_view.slt
   
   1. query result mismatch:
   [SQL] EXPLAIN SELECT
     REGEXP_REPLACE(column1_utf8view, '^https?://(?:www\.)?([^/]+)/.*$', '\1') 
AS k
   FROM test;
   [Diff] (-expected|+actual)
       logical_plan
   -   01)Projection: regexp_replace(test.column1_utf8view, 
Utf8("^https?://(?:www\.)?([^/]+)/.*$"), Utf8("\1")) AS k
   +   01)Projection: regexp_replace(test.column1_utf8view, 
Utf8View("^https?://(?:www\.)?([^/]+)/.*$"), Utf8View("\1")) AS k
       02)--TableScan: test projection=[column1_utf8view]
   at 
/Users/matt/git/datafusion/datafusion/sqllogictest/test_files/string/string_view.slt:801
   ```
   Which might be okay? Casting the literals to `Utf8View` is pretty harmless.



-- 
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]

Reply via email to