paleolimbot commented on issue #18223:
URL: https://github.com/apache/datafusion/issues/18223#issuecomment-3661808706

   Adding a note here to track an actual implementation of casting to an 
extension type to avoid fragmenting the places where we talk about this too 
much ( 
https://github.com/apache/datafusion/pull/18136#pullrequestreview-3574203120 ). 
We could implement this using a dedicated cast registry (e.g., how DuckDB does 
this), or using another trait on the extension like:
   
   ```rust
   pub trait LogicalType {
      fn type_common(&self, other: &dyn LogicalType) -> Result<Arc<dyn 
LogicalType>>;
      fn cast_to_physical_expr(&self, cast: &Cast) -> Result<Arc<dyn 
PhysicalExpr>>;
   }
   ```
   
   (`type_common` would be required for the example in that comment to work, 
such that both sides of a `BinaryOp` could be cast to a common type before 
comparison)


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