geoffreyclaude commented on code in PR #17843:
URL: https://github.com/apache/datafusion/pull/17843#discussion_r2533035450
##########
datafusion/sql/src/relation/mod.rs:
##########
@@ -24,19 +24,119 @@ use datafusion_common::{
not_impl_err, plan_err, DFSchema, Diagnostic, Result, Span, Spans,
TableReference,
};
use datafusion_expr::builder::subquery_alias;
+use datafusion_expr::planner::{
+ PlannedRelation, RelationPlannerContext, RelationPlanning,
+};
use datafusion_expr::{expr::Unnest, Expr, LogicalPlan, LogicalPlanBuilder};
use datafusion_expr::{Subquery, SubqueryAlias};
use sqlparser::ast::{FunctionArg, FunctionArgExpr, Spanned, TableFactor};
mod join;
+struct SqlToRelRelationContext<'a, 'b, S: ContextProvider> {
Review Comment:
To be clear, most users should never need to think about the registration
order of custom planners.
It only matters when both of these are true:
- You have more than one custom planner, and
- They both handle (intercept) the same relation.
In practice, this should be very rare.
Here’s a realistic example of when it *could* happen:
The user installs the `datafusion-extended-sql` extension.
This extension automatically registers planners for several SQL constructs,
including PIVOT.
The user also prefers the PIVOT implementation from the dedicated
`datafusion-pivot` extension for some reason,
so they register that planner *after* `datafusion-extended-sql`.
In this setup:
All planners from `datafusion-extended-sql` will still be used as normal.
Except for PIVOT: that will now be handled by the PIVOT planner from
`datafusion-pivot`,
because it was registered later and overrides the earlier one for that
relation.
--
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]