Apache DataFusion SQL Query Engine
ARROW-9695: [Rust] Improve comments on LogicalPlan enum variants
alamb37a2f0dbe8a8
diff --git a/rust/datafusion/src/logicalplan.rs b/rust/datafusion/src/logicalplan.rsindex 507e8b0af0..f8be242274 100644--- a/rust/datafusion/src/logicalplan.rs+++ b/rust/datafusion/src/logicalplan.rs@@ -658,43 +658,53 @@ impl fmt::Debug for Expr {/// Selection, etc) and can be created by the SQL query planner and the DataFrame API.#[derive(Clone)]pub enum LogicalPlan {- /// A Projection (essentially a SELECT with an expression list)+ /// Evaluates an arbitrary list of expressions (essentially a+ /// SELECT with an expression list) on its input.Projection {/// The list of expressionsexpr: Vec<Expr>,- /// The incoming logic plan+ /// The incoming logical planinput: Box<LogicalPlan>,- /// The schema description+ /// The schema description of the outputschema: Box<Schema>,},- /// A Selection (essentially a WHERE clause with a predicate expression)+ /// Filters rows from its input that do not match an+ /// expression (essentially a WHERE clause with a predicate+ /// expression).+ ///+ /// Semantically, `<expr>` is evaluated for each row of the input;+ /// If the value of `<expr>` is true, the input row is passed to+ /// the output. If the value of `<expr>` is false, the row is+ /// discarded.Selection {- /// The expression+ /// The expression. Must have Boolean type.expr: Expr,- /// The incoming logic plan+ /// The incoming logical planinput: Box<LogicalPlan>,},- /// Represents a list of aggregate expressions with optional grouping expressions+ /// Aggregates its input based on a set of grouping and aggregate+ /// expressions (e.g. SUM).Aggregate {- /// The incoming logic plan+ /// The incoming logical planinput: Box<LogicalPlan>,/// Grouping expressionsgroup_expr: Vec<Expr>,/// Aggregate expressionsaggr_expr: Vec<Expr>,- /// The schema description+ /// The schema description of the aggregate outputschema: Box<Schema>,},- /// Represents a list of sort expressions to be applied to a relation+ /// Sorts its input according to a list of sort expressions.Sort {/// The sort expressionsexpr: Vec<Expr>,- /// The incoming logic plan+ /// The incoming logical planinput: Box<LogicalPlan>,- /// The schema description+ /// The schema description of the otuputschema: Box<Schema>,},- /// A table scan against a table that has been registered on a context+ /// Produces rows from a table that has been registered on a+ /// contextTableScan {/// The name of the schemaschema_name: String,@@ -704,10 +714,10 @@ pub enum LogicalPlan {table_schema: Box<Schema>,/// Optional column indices to use as a projectionprojection: Option<Vec<usize>>,- /// The projected schema+ /// The schema description of the outputprojected_schema: Box<Schema>,},- /// A table scan against a vector of record batches+ /// Produces rows that come from a `Vec` of in memory `RecordBatch`esInMemoryScan {/// Record batch partitionsdata: Vec<Vec<RecordBatch>>,@@ -715,10 +725,10 @@ pub enum LogicalPlan {schema: Box<Schema>,/// Optional column indices to use as a projectionprojection: Option<Vec<usize>>,- /// The projected schema+ /// The schema description of the outputprojected_schema: Box<Schema>,},- /// A table scan against a Parquet data source+ /// Produces rows by scanning Parquet file(s)ParquetScan {/// The path to the filespath: String,@@ -726,10 +736,10 @@ pub enum LogicalPlan {schema: Box<Schema>,/// Optional column indices to use as a projectionprojection: Option<Vec<usize>>,- /// The projected schema+ /// The schema description of the outputprojected_schema: Box<Schema>,},- /// A table scan against a CSV data source+ /// Produces rows by scanning a CSV file(s)CsvScan {/// The path to the filespath: String,@@ -741,24 +751,24 @@ pub enum LogicalPlan {delimiter: Option<u8>,/// Optional column indices to use as a projectionprojection: Option<Vec<usize>>,- /// The projected schema+ /// The schema description of the outputprojected_schema: Box<Schema>,},- /// An empty relation with an empty schema+ /// Produces no rows: An empty relation with an empty schemaEmptyRelation {- /// The schema description+ /// The schema description of the outputschema: Box<Schema>,},- /// Represents the maximum number of records to return+ /// Produces the first `n` tuples from its input and discards the rest.Limit {/// The limitn: usize,/// The logical planinput: Box<LogicalPlan>,- /// The schema description+ /// The schema description of the outputschema: Box<Schema>,},- /// Represents a create external table expression.+ /// Creates an external table.CreateExternalTable {/// The table schemaschema: Box<Schema>,