Skip to content

Commit

Permalink
Minor: add documentation note about NullState (#12791)
Browse files Browse the repository at this point in the history
* Minor: add documentation note about `NullState`

* Remove unecessary copy/paste license

* Update datafusion/expr-common/src/groups_accumulator.rs
  • Loading branch information
alamb authored Oct 9, 2024
1 parent 9df957b commit 29e9af2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
10 changes: 10 additions & 0 deletions datafusion/expr-common/src/groups_accumulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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.html
fn update_batch(
&mut self,
values: &[ArrayRef],
Expand Down
15 changes: 0 additions & 15 deletions datafusion/functions-aggregate/src/min_max.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 29e9af2

Please sign in to comment.