alamb commented on a change in pull request #9565:
URL: https://github.com/apache/arrow/pull/9565#discussion_r584911188



##########
File path: rust/datafusion/src/physical_plan/type_coercion.rs
##########
@@ -168,20 +168,35 @@ fn maybe_data_types(
 pub fn can_coerce_from(type_into: &DataType, type_from: &DataType) -> bool {
     use self::DataType::*;
     match type_into {
-        Int8 => matches!(type_from, Int8),
-        Int16 => matches!(type_from, Int8 | Int16 | UInt8),
-        Int32 => matches!(type_from, Int8 | Int16 | Int32 | UInt8 | UInt16),
+        Int8 => matches!(type_from, Int8 | Utf8 | LargeUtf8),

Review comment:
       > How about I revert the coercion logic from this PR and re-add the 
explicit cast in the tests. 
   Sounds like a great plan
   
   > I think there is a major piece of work to fully address CAST/coercion.
   I agree 💯 

##########
File path: rust/datafusion/src/physical_plan/type_coercion.rs
##########
@@ -168,20 +168,35 @@ fn maybe_data_types(
 pub fn can_coerce_from(type_into: &DataType, type_from: &DataType) -> bool {
     use self::DataType::*;
     match type_into {
-        Int8 => matches!(type_from, Int8),
-        Int16 => matches!(type_from, Int8 | Int16 | UInt8),
-        Int32 => matches!(type_from, Int8 | Int16 | Int32 | UInt8 | UInt16),
+        Int8 => matches!(type_from, Int8 | Utf8 | LargeUtf8),

Review comment:
       > How about I revert the coercion logic from this PR and re-add the 
explicit cast in the tests. 
   
   Sounds like a great plan
   
   > I think there is a major piece of work to fully address CAST/coercion.
   
   I agree 💯 




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

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


Reply via email to