xudong963 commented on a change in pull request #1309:
URL: https://github.com/apache/arrow-datafusion/pull/1309#discussion_r750452529
##########
File path: datafusion/src/logical_plan/plan.rs
##########
@@ -67,41 +108,12 @@ pub enum JoinConstraint {
/// from leaves up to the root to produce the query result.
#[derive(Clone)]
pub enum LogicalPlan {
- /// Evaluates an arbitrary list of expressions (essentially a
- /// SELECT with an expression list) on its input.
- Projection {
- /// The list of expressions
- expr: Vec<Expr>,
- /// The incoming logical plan
- input: Arc<LogicalPlan>,
- /// The schema description of the output
- schema: DFSchemaRef,
- /// Projection output relation alias
- alias: Option<String>,
- },
- /// Filters rows from its input that do not match an
- /// expression (essentially a WHERE clause with a predicate
- /// expression).
- ///
- /// Semantically, `<predicate>` is evaluated for each row of the input;
- /// If the value of `<predicate>` is true, the input row is passed to
- /// the output. If the value of `<predicate>` is false, the row is
- /// discarded.
- Filter {
- /// The predicate expression, which must have Boolean type.
- predicate: Expr,
- /// The incoming logical plan
- input: Arc<LogicalPlan>,
- },
- /// Window its input based on a set of window spec and window function
(e.g. SUM or RANK)
- Window {
- /// The incoming logical plan
- input: Arc<LogicalPlan>,
- /// The window function expression
- window_expr: Vec<Expr>,
- /// The schema description of the window output
- schema: DFSchemaRef,
- },
+ /// the ProjectionPlan
+ Projection(ProjectionPlan),
+ /// the FilterPlan
+ Filter(FilterPlan),
+ /// the WindowPlan
Review comment:
ditto
##########
File path: ballista/rust/core/src/serde/logical_plan/to_proto.rs
##########
@@ -777,9 +778,9 @@ impl TryInto<protobuf::LogicalPlanNode> for &LogicalPlan {
)))
}
}
- LogicalPlan::Projection {
+ LogicalPlan::Projection(ProjectionPlan {
Review comment:
I think we can use the style, `LogicalPlan::Projection(p) => {p.var1,
p.var2, ...}`.
FYI,
https://github.com/apache/arrow-datafusion/issues/1228#issuecomment-969443381
##########
File path: ballista/rust/core/src/serde/logical_plan/to_proto.rs
##########
@@ -794,7 +795,7 @@ impl TryInto<protobuf::LogicalPlanNode> for &LogicalPlan {
},
))),
}),
- LogicalPlan::Filter { predicate, input } => {
+ LogicalPlan::Filter(FilterPlan { predicate, input }) => {
Review comment:
ditto, you can also check other places.
##########
File path: datafusion/src/logical_plan/plan.rs
##########
@@ -67,41 +108,12 @@ pub enum JoinConstraint {
/// from leaves up to the root to produce the query result.
#[derive(Clone)]
pub enum LogicalPlan {
- /// Evaluates an arbitrary list of expressions (essentially a
- /// SELECT with an expression list) on its input.
- Projection {
- /// The list of expressions
- expr: Vec<Expr>,
- /// The incoming logical plan
- input: Arc<LogicalPlan>,
- /// The schema description of the output
- schema: DFSchemaRef,
- /// Projection output relation alias
- alias: Option<String>,
- },
- /// Filters rows from its input that do not match an
- /// expression (essentially a WHERE clause with a predicate
- /// expression).
- ///
- /// Semantically, `<predicate>` is evaluated for each row of the input;
- /// If the value of `<predicate>` is true, the input row is passed to
- /// the output. If the value of `<predicate>` is false, the row is
- /// discarded.
- Filter {
- /// The predicate expression, which must have Boolean type.
- predicate: Expr,
- /// The incoming logical plan
- input: Arc<LogicalPlan>,
- },
- /// Window its input based on a set of window spec and window function
(e.g. SUM or RANK)
- Window {
- /// The incoming logical plan
- input: Arc<LogicalPlan>,
- /// The window function expression
- window_expr: Vec<Expr>,
- /// The schema description of the window output
- schema: DFSchemaRef,
- },
+ /// the ProjectionPlan
Review comment:
I think we don't need annotation here. cc @alamb
nit: It's good to start with an upper case, such as `The projection plan`.
--
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]