alamb commented on code in PR #11485:
URL: https://github.com/apache/datafusion/pull/11485#discussion_r1680059944
##########
datafusion/sql/src/planner.rs:
##########
@@ -186,8 +185,6 @@ pub struct SqlToRel<'a, S: ContextProvider> {
pub(crate) context_provider: &'a S,
pub(crate) options: ParserOptions,
pub(crate) normalizer: IdentNormalizer,
- /// user defined planner extensions
Review Comment:
👍
##########
datafusion/sql/src/planner.rs:
##########
@@ -196,12 +193,6 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
Self::new_with_options(context_provider, ParserOptions::default())
}
- /// add an user defined planner
- pub fn with_user_defined_planner(mut self, planner: Arc<dyn ExprPlanner>)
-> Self {
Review Comment:
I think it makes sense to use the underlying session state as the source of
truth
##########
datafusion/expr/src/planner.rs:
##########
@@ -60,6 +60,9 @@ pub trait ContextProvider {
not_impl_err!("Recursive CTE is not implemented")
}
+ /// Getter for expr planners
+ fn get_expr_planners(&self) -> Vec<Arc<dyn ExprPlanner>>;
Review Comment:
I spent some time trying to figure out if we could avoid this Vec cloning
all the time -- with
```suggestion
fn get_expr_planners(&self) -> &[Arc<dyn ExprPlanner>] {&[]}
```
I think this is possible -- I made
https://github.com/jayzhan211/arrow-datafusion/pull/3 to show how it looks
--
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]