notfilippo commented on PR #12853:
URL: https://github.com/apache/datafusion/pull/12853#issuecomment-2437061185

   @jayzhan211 I think this approach goes against the problems that logical 
types try to solve. Specifically I think that we could (and should) define some 
kind of casting rules for a logical types (`NativeType::*` -> `String`, `Int*` 
<-> `Float*`, `JSON` -> `String`) via a method to be implemented in the 
LogicalType trait (`can_cast_to(&self, rhs: &dyn LogicalType)`). Then during 
physical planning when a function that takes a Logical string receives in input 
a Logical Int8 it can only check if the logical cast is valid. During logical 
planning (and/or execution if we implement runtime adaptiveness) you would have 
instead type information for all the function parameters and you could decide 
to which type it makes more sense to cast.


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