2010YOUY01 commented on code in PR #11787:
URL: https://github.com/apache/datafusion/pull/11787#discussion_r1702464278


##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -573,6 +573,8 @@ fn coerced_from<'a>(
         (Interval(_), _) if matches!(type_from, Utf8 | LargeUtf8) => {
             Some(type_into.clone())
         }
+        // We can go into a Utf8View from a Utf8 or LargeUtf8
+        (Utf8View, _) if matches!(type_from, Utf8 | LargeUtf8) => 
Some(type_into.clone()),

Review Comment:
   LargeUtf8 has 64 bit length, Utf8View only got 32 bit length.
   Loos like `LargeUtf8 -> Utf8View` is not possible?



##########
datafusion/functions/src/string/starts_with.rs:
##########
@@ -52,14 +48,12 @@ impl Default for StartsWithFunc {
 
 impl StartsWithFunc {
     pub fn new() -> Self {
-        use DataType::*;
         Self {
             signature: Signature::one_of(
                 vec![
-                    Exact(vec![Utf8, Utf8]),
-                    Exact(vec![Utf8, LargeUtf8]),
-                    Exact(vec![LargeUtf8, Utf8]),
-                    Exact(vec![LargeUtf8, LargeUtf8]),
+                    Exact(vec![DataType::Utf8View, DataType::Utf8View]),

Review Comment:
   ```suggestion
                       // Planner attempts coercion to the target type starting 
with the most preferred candidate.
                       // For example, given input `(Utf8View, Utf8)`, it first 
tries coercing to `(Utf8View, Utf8View)`.
                       // If that fails, it proceeds to `(Utf8, Utf8)`.
   ```



-- 
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...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to