Skip to content

Commit 15d1a43

Browse files
committed
Allow direct construction of LogicalPlan nodes
This removes the self-imposed `non_exhaustive` limitation on `LogicalPlan` types so that we can construct plan nodes without going through the `try_new` methods, wthich imposes Datafusion dialect semantics. We should upstream this change.
1 parent f739684 commit 15d1a43

File tree

1 file changed

+1
-8
lines changed
  • datafusion/expr/src/logical_plan

1 file changed

+1
-8
lines changed

datafusion/expr/src/logical_plan/plan.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,8 +2121,6 @@ impl PartialOrd for Values {
21212121
/// Evaluates an arbitrary list of expressions (essentially a
21222122
/// SELECT with an expression list) on its input.
21232123
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
2124-
// mark non_exhaustive to encourage use of try_new/new()
2125-
#[non_exhaustive]
21262124
pub struct Projection {
21272125
/// The list of expressions
21282126
pub expr: Vec<Expr>,
@@ -2206,8 +2204,6 @@ pub fn projection_schema(input: &LogicalPlan, exprs: &[Expr]) -> Result<Arc<DFSc
22062204

22072205
/// Aliased subquery
22082206
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2209-
// mark non_exhaustive to encourage use of try_new/new()
2210-
#[non_exhaustive]
22112207
pub struct SubqueryAlias {
22122208
/// The incoming logical plan
22132209
pub input: Arc<LogicalPlan>,
@@ -2296,7 +2292,6 @@ impl PartialOrd for SubqueryAlias {
22962292
/// Filter should not be created directly but instead use `try_new()`
22972293
/// and that these fields are only pub to support pattern matching
22982294
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Hash)]
2299-
#[non_exhaustive]
23002295
pub struct Filter {
23012296
/// The predicate expression, which must have Boolean type.
23022297
pub predicate: Expr,
@@ -2595,7 +2590,7 @@ impl Debug for TableScan {
25952590
.field("projected_schema", &self.projected_schema)
25962591
.field("filters", &self.filters)
25972592
.field("fetch", &self.fetch)
2598-
.finish_non_exhaustive()
2593+
.finish()
25992594
}
26002595
}
26012596

@@ -3509,8 +3504,6 @@ impl PartialOrd for DistinctOn {
35093504
/// "C+B" and "SUM(A)" are the names of the output columns. Note that "C+B" is a
35103505
/// single new column
35113506
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3512-
// mark non_exhaustive to encourage use of try_new/new()
3513-
#[non_exhaustive]
35143507
pub struct Aggregate {
35153508
/// The incoming logical plan
35163509
pub input: Arc<LogicalPlan>,

0 commit comments

Comments
 (0)