Skip to content

Apache DataFusion SQL Query Engine

Minor: Add comment on input_schema from AggregateExec (#7727)

Liang-Chi Hsieha8c01de49259
diff --git a/datafusion/physical-plan/src/aggregates/mod.rs b/datafusion/physical-plan/src/aggregates/mod.rs
index 6ab991c6f5..546abcfc4a 100644
--- a/datafusion/physical-plan/src/aggregates/mod.rs
+++ b/datafusion/physical-plan/src/aggregates/mod.rs
@@ -285,7 +285,9 @@ pub struct AggregateExec {
schema: SchemaRef,
/// Input schema before any aggregation is applied. For partial aggregate this will be the
/// same as input.schema() but for the final aggregate it will be the same as the input
- /// to the partial aggregate
+ /// to the partial aggregate, i.e., partial and final aggregates have same `input_schema`.
+ /// We need the input schema of partial aggregate to be able to deserialize aggregate
+ /// expressions from protobuf for final aggregate.
pub input_schema: SchemaRef,
/// The columns map used to normalize out expressions like Partitioning and PhysicalSortExpr
/// The key is the column from the input schema and the values are the columns from the output schema