goldmedal commented on code in PR #13294:
URL: https://github.com/apache/datafusion/pull/13294#discussion_r1833739520


##########
datafusion/sql/src/planner.rs:
##########
@@ -401,6 +401,14 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
     }
 
     pub(crate) fn convert_data_type(&self, sql_type: &SQLDataType) -> 
Result<DataType> {
+        // First check if any of the registered expr_planners can handle this 
type
+        for expr_planner in self.context_provider.get_expr_planners() {

Review Comment:
   An independent trait looks good to me.  I'm thinking what's a good way to 
register the custom planner.
   Maybe introduce a method in `ContextProvder::get_data_type_planner`?
   
   ```rust
   pub trait ContextProvider {
   ...
     fn get_data_type(&self) -> Option<Arc<dyn DataTypePlanner>>
         None
     }
   }
   ```
   
   We can allow registering the data type planner in `SessionState`. WDYT?



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