NGA-TRAN commented on code in PR #17843:
URL: https://github.com/apache/datafusion/pull/17843#discussion_r2532431932
##########
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:
I’ve been thinking about this. In addition to providing a code example, it
would be valuable to add documentation for this extension if you want broader
adoption.
You may already have ideas for your doc, but to me this feels very similar
to the plan tree that DataFusion generates. The first register_relation_planner
acts as the leaf node, and the last one becomes the root. When executed, the
root node starts first and then recursively triggers its children—so the
execution flows just like a DataFusion query plan.
Another remarkable aspect of this framework is that you can connect
existing, standard logical plans in any order within your tree (please correct
me if I’m mistaken). This means users can either build a fully custom tree/plan
or simply plug in custom components alongside existing ones, in whatever order
they choose.
--
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]