Skip to content

Commit c8bd776

Browse files
authored
chore: Make GroupValues and APIs on PhysicalGroupBy aggregation APIs public (#16733)
* chore: public some aggregate related api * fix: cargo doc ci
1 parent c01c71f commit c8bd776

File tree

2 files changed

+11
-9
lines changed
  • datafusion/physical-plan/src/aggregates

2 files changed

+11
-9
lines changed

datafusion/physical-plan/src/aggregates/group_values/mod.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ mod null_builder;
8484
/// Each distinct group in a hash aggregation is identified by a unique group id
8585
/// (usize) which is assigned by instances of this trait. Group ids are
8686
/// continuous without gaps, starting from 0.
87-
pub(crate) trait GroupValues: Send {
87+
pub trait GroupValues: Send {
8888
/// Calculates the group id for each input row of `cols`, assigning new
8989
/// group ids as necessary.
9090
///
@@ -121,13 +121,15 @@ pub(crate) trait GroupValues: Send {
121121
/// will be chosen.
122122
///
123123
/// - If group by multiple columns, and all column types have the specific
124-
/// [`GroupColumn`] implementations, [`GroupValuesColumn`] will be chosen.
124+
/// `GroupColumn` implementations, `GroupValuesColumn` will be chosen.
125125
///
126-
/// - Otherwise, the general implementation [`GroupValuesRows`] will be chosen.
126+
/// - Otherwise, the general implementation `GroupValuesRows` will be chosen.
127127
///
128-
/// [`GroupColumn`]: crate::aggregates::group_values::multi_group_by::GroupColumn
128+
/// `GroupColumn`: crate::aggregates::group_values::multi_group_by::GroupColumn
129+
/// `GroupValuesColumn`: crate::aggregates::group_values::multi_group_by::GroupValuesColumn
130+
/// `GroupValuesRows`: crate::aggregates::group_values::row::GroupValuesRows
129131
///
130-
pub(crate) fn new_group_values(
132+
pub fn new_group_values(
131133
schema: SchemaRef,
132134
group_ordering: &GroupOrdering,
133135
) -> Result<Box<dyn GroupValues>> {

datafusion/physical-plan/src/aggregates/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use datafusion_physical_expr_common::sort_expr::{
5454

5555
use itertools::Itertools;
5656

57-
pub(crate) mod group_values;
57+
pub mod group_values;
5858
mod no_grouping;
5959
pub mod order;
6060
mod row_hash;
@@ -268,7 +268,7 @@ impl PhysicalGroupBy {
268268
}
269269

270270
/// Returns the number expression as grouping keys.
271-
fn num_group_exprs(&self) -> usize {
271+
pub fn num_group_exprs(&self) -> usize {
272272
if self.is_single() {
273273
self.expr.len()
274274
} else {
@@ -1318,7 +1318,7 @@ fn evaluate(
13181318
}
13191319

13201320
/// Evaluates expressions against a record batch.
1321-
pub(crate) fn evaluate_many(
1321+
pub fn evaluate_many(
13221322
expr: &[Vec<Arc<dyn PhysicalExpr>>],
13231323
batch: &RecordBatch,
13241324
) -> Result<Vec<Vec<ArrayRef>>> {
@@ -1372,7 +1372,7 @@ fn group_id_array(group: &[bool], batch: &RecordBatch) -> Result<ArrayRef> {
13721372
/// The outer Vec appears to be for grouping sets
13731373
/// The inner Vec contains the results per expression
13741374
/// The inner-inner Array contains the results per row
1375-
pub(crate) fn evaluate_group_by(
1375+
pub fn evaluate_group_by(
13761376
group_by: &PhysicalGroupBy,
13771377
batch: &RecordBatch,
13781378
) -> Result<Vec<Vec<ArrayRef>>> {

0 commit comments

Comments
 (0)