Skip to content

Commit 29e9af2

Browse files
authored
Minor: add documentation note about NullState (#12791)
* Minor: add documentation note about `NullState` * Remove unecessary copy/paste license * Update datafusion/expr-common/src/groups_accumulator.rs
1 parent 9df957b commit 29e9af2

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

datafusion/expr-common/src/groups_accumulator.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ impl EmitTo {
9090
/// faster for queries with many group values. See the [Aggregating Millions of
9191
/// Groups Fast blog] for more background.
9292
///
93+
/// [`NullState`] can help keep the state for groups that have not seen any
94+
/// values and produce the correct output for those groups.
95+
///
96+
/// [`NullState`]: https://docs.rs/datafusion/latest/datafusion/physical_expr/struct.NullState.html
97+
///
9398
/// # Details
9499
/// Each group is assigned a `group_index` by the hash table and each
95100
/// accumulator manages the specific state, one per `group_index`.
@@ -117,6 +122,11 @@ pub trait GroupsAccumulator: Send {
117122
///
118123
/// Note that subsequent calls to update_batch may have larger
119124
/// total_num_groups as new groups are seen.
125+
///
126+
/// See [`NullState`] to help keep the state for groups that have not seen any
127+
/// values and produce the correct output for those groups.
128+
///
129+
/// [`NullState`]: https://docs.rs/datafusion/latest/datafusion/physical_expr/struct.NullState.html
120130
fn update_batch(
121131
&mut self,
122132
values: &[ArrayRef],

datafusion/functions-aggregate/src/min_max.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,6 @@
1717
//! [`Max`] and [`MaxAccumulator`] accumulator for the `max` function
1818
//! [`Min`] and [`MinAccumulator`] accumulator for the `min` function
1919
20-
// distributed with this work for additional information
21-
// regarding copyright ownership. The ASF licenses this file
22-
// to you under the Apache License, Version 2.0 (the
23-
// "License"); you may not use this file except in compliance
24-
// with the License. You may obtain a copy of the License at
25-
//
26-
// http://www.apache.org/licenses/LICENSE-2.0
27-
//
28-
// Unless required by applicable law or agreed to in writing,
29-
// software distributed under the License is distributed on an
30-
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
31-
// KIND, either express or implied. See the License for the
32-
// specific language governing permissions and limitations
33-
// under the License.
34-
3520
use arrow::array::{
3621
ArrayRef, BinaryArray, BinaryViewArray, BooleanArray, Date32Array, Date64Array,
3722
Decimal128Array, Decimal256Array, Float16Array, Float32Array, Float64Array,

0 commit comments

Comments
 (0)