Apache DataFusion SQL Query Engine
Minor: add documentation note about `NullState` (#12791)
Andrew Lamb29e9af27ff8c
diff --git a/datafusion/expr-common/src/groups_accumulator.rs b/datafusion/expr-common/src/groups_accumulator.rsindex 8e81c51d84..d19d8e4696 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`] 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.htmlfn update_batch(&mut self,values: &[ArrayRef],diff --git a/datafusion/functions-aggregate/src/min_max.rs b/datafusion/functions-aggregate/src/min_max.rsindex e0b029f090..7d2e8e66e2 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,