diff --git a/datafusion/datasource-parquet/src/opener.rs b/datafusion/datasource-parquet/src/opener.rs index 8f521c3f4ef74..3c17cadc47e6d 100644 --- a/datafusion/datasource-parquet/src/opener.rs +++ b/datafusion/datasource-parquet/src/opener.rs @@ -277,8 +277,9 @@ impl FileOpener for ParquetOpener { // - The table schema as defined by the TableProvider. // This is what the user sees, what they get when they `SELECT * FROM table`, etc. // - The logical file schema: this is the table schema minus any hive partition columns and projections. - // This is what the physicalfile schema is coerced to. - // - The physical file schema: this is the schema as defined by the parquet file. This is what the parquet file actually contains. + // This is what the physical file schema is coerced to. + // - The physical file schema: this is the schema that the arrow-rs + // parquet reader will actually produce. let mut physical_file_schema = Arc::clone(reader_metadata.schema()); // The schema loaded from the file may not be the same as the diff --git a/datafusion/physical-expr/src/projection.rs b/datafusion/physical-expr/src/projection.rs index 6f12fbdfe794c..18211c7d35e96 100644 --- a/datafusion/physical-expr/src/projection.rs +++ b/datafusion/physical-expr/src/projection.rs @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +//! [`ProjectionExpr`] and [`ProjectionExprs`] for representing projections. + use std::ops::Deref; use std::sync::Arc; @@ -35,7 +37,7 @@ use datafusion_physical_expr_common::utils::evaluate_expressions_to_arrays; use indexmap::IndexMap; use itertools::Itertools; -/// A projection expression as used by projection operations. +/// An expression used by projection operations. /// /// The expression is evaluated and the result is stored in a column /// with the name specified by `alias`. @@ -43,6 +45,8 @@ use itertools::Itertools; /// For example, the SQL expression `a + b AS sum_ab` would be represented /// as a `ProjectionExpr` where `expr` is the expression `a + b` /// and `alias` is the string `sum_ab`. +/// +/// See [`ProjectionExprs`] for a collection of projection expressions. #[derive(Debug, Clone)] pub struct ProjectionExpr { /// The expression that will be evaluated. @@ -107,11 +111,14 @@ impl From for (Arc, String) { } } -/// A collection of projection expressions. +/// A collection of [`ProjectionExpr`] instances, representing a complete +/// projection operation. +/// +/// Projection operations are used in query plans to select specific columns or +/// compute new columns based on existing ones. /// -/// This struct encapsulates multiple `ProjectionExpr` instances, -/// representing a complete projection operation and provides -/// methods to manipulate and analyze the projection as a whole. +/// See [`ProjectionExprs::from_indices`] to select a subset of columns by +/// indices. #[derive(Debug, Clone, PartialEq, Eq)] pub struct ProjectionExprs { exprs: Vec,