andygrove commented on a change in pull request #8097:
URL: https://github.com/apache/arrow/pull/8097#discussion_r484556394
##########
File path: rust/datafusion/src/logical_plan/mod.rs
##########
@@ -755,8 +756,72 @@ impl fmt::Debug for Expr {
}
}
-/// The LogicalPlan represents different types of relations (such as
Projection,
-/// Filter, etc) and can be created by the SQL query planner and the DataFrame
API.
+/// This defines the interface for `LogicalPlan` nodes that can be
+/// used to extend DataFusion with custom relational operators.
+///
+/// See the example in
+/// [user_defined_plan.rs](../../tests/user_defined_plan.rs) for an
+/// example of how to use this extenison API
+pub trait ExtensionPlanNode: Debug {
+ /// Return a reference to self as Any, to support dynamic downcasting
+ fn as_any(&self) -> &dyn Any;
+
+ /// Return the the logical plan's inputs
+ fn inputs(&self) -> Vec<&LogicalPlan>;
Review comment:
I've been thinking lately that we should start standardizing on
`children` rather than `inputs`. What do others think about this? This doesn't
have to happen in this PR though.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]