From b39e663eeb2efdb7963eb105ad23c769bd4e0666 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Mon, 7 Oct 2024 09:55:06 -0400 Subject: [PATCH 1/3] Minor: add documentation note about `NullState` --- datafusion/expr-common/src/groups_accumulator.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/datafusion/expr-common/src/groups_accumulator.rs b/datafusion/expr-common/src/groups_accumulator.rs index 8e81c51d8460..920e8edf0597 100644 --- a/datafusion/expr-common/src/groups_accumulator.rs +++ b/datafusion/expr-common/src/groups_accumulator.rs @@ -90,6 +90,11 @@ impl EmitTo { /// faster for queries with many group values. See the [Aggregating Millions of /// Groups Fast blog] for more background. /// +/// [`NullState`] can help keep the state for groups that have not seen any +/// values and produce the correct output for those groups. +/// +/// [`NullState`]: https://docs.rs/datafusion/latest/datafusion/physical_expr/struct.NullState.html +/// /// # Details /// Each group is assigned a `group_index` by the hash table and each /// accumulator manages the specific state, one per `group_index`. @@ -117,6 +122,11 @@ pub trait GroupsAccumulator: Send { /// /// Note that subsequent calls to update_batch may have larger /// total_num_groups as new groups are seen. + /// + /// See [`NullState`] tp help keep the state for groups that have not seen any + /// values and produce the correct output for those groups. + /// + /// [`NullState`]: https://docs.rs/datafusion/latest/datafusion/physical_expr/struct.NullState.html fn update_batch( &mut self, values: &[ArrayRef], From 7c70ab06825145eaaf879b072d91d0c378ba786b Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Mon, 7 Oct 2024 09:55:50 -0400 Subject: [PATCH 2/3] Remove unecessary copy/paste license --- datafusion/functions-aggregate/src/min_max.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/datafusion/functions-aggregate/src/min_max.rs b/datafusion/functions-aggregate/src/min_max.rs index 1ce1abe09ea8..2498cc3b1c45 100644 --- a/datafusion/functions-aggregate/src/min_max.rs +++ b/datafusion/functions-aggregate/src/min_max.rs @@ -17,21 +17,6 @@ //! [`Max`] and [`MaxAccumulator`] accumulator for the `max` function //! [`Min`] and [`MinAccumulator`] accumulator for the `min` function -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - use arrow::array::{ ArrayRef, BinaryArray, BinaryViewArray, BooleanArray, Date32Array, Date64Array, Decimal128Array, Decimal256Array, Float16Array, Float32Array, Float64Array, From ae4232cbae7db9c73834c02d4b285b8b7f23173e Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Tue, 8 Oct 2024 07:02:02 -0400 Subject: [PATCH 3/3] Update datafusion/expr-common/src/groups_accumulator.rs --- datafusion/expr-common/src/groups_accumulator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datafusion/expr-common/src/groups_accumulator.rs b/datafusion/expr-common/src/groups_accumulator.rs index 920e8edf0597..d19d8e469688 100644 --- a/datafusion/expr-common/src/groups_accumulator.rs +++ b/datafusion/expr-common/src/groups_accumulator.rs @@ -123,7 +123,7 @@ pub trait GroupsAccumulator: Send { /// Note that subsequent calls to update_batch may have larger /// total_num_groups as new groups are seen. /// - /// See [`NullState`] tp help keep the state for groups that have not seen any + /// See [`NullState`] to help keep the state for groups that have not seen any /// values and produce the correct output for those groups. /// /// [`NullState`]: https://docs.rs/datafusion/latest/datafusion/physical_expr/struct.NullState.html