Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datafusion/expr/src/logical_plan/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ pub fn build_join_schema(
///
/// This allows MySQL style selects like
/// `SELECT col FROM t WHERE pk = 5` if col is unique
fn add_group_by_exprs_from_dependencies(
pub fn add_group_by_exprs_from_dependencies(
mut group_expr: Vec<Expr>,
schema: &DFSchemaRef,
) -> Result<Vec<Expr>> {
Expand Down
20 changes: 10 additions & 10 deletions datafusion/physical-plan/src/aggregates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ use datafusion_physical_expr::{

use itertools::Itertools;

mod group_values;
pub mod group_values;
mod no_grouping;
mod order;
pub mod order;
mod row_hash;
mod topk;
mod topk_stream;
Expand Down Expand Up @@ -128,14 +128,14 @@ impl AggregateMode {
#[derive(Clone, Debug, Default)]
pub struct PhysicalGroupBy {
/// Distinct (Physical Expr, Alias) in the grouping set
expr: Vec<(Arc<dyn PhysicalExpr>, String)>,
pub expr: Vec<(Arc<dyn PhysicalExpr>, String)>,
Comment thread
emgeee marked this conversation as resolved.
Outdated
/// Corresponding NULL expressions for expr
null_expr: Vec<(Arc<dyn PhysicalExpr>, String)>,
pub null_expr: Vec<(Arc<dyn PhysicalExpr>, String)>,
/// Null mask for each group in this grouping set. Each group is
/// composed of either one of the group expressions in expr or a null
/// expression in null_expr. If `groups[i][j]` is true, then the the
/// j-th expression in the i-th group is NULL, otherwise it is `expr[j]`.
groups: Vec<Vec<bool>>,
pub groups: Vec<Vec<bool>>,
}

impl PhysicalGroupBy {
Expand Down Expand Up @@ -925,7 +925,7 @@ pub fn concat_slices<T: Clone>(lhs: &[T], rhs: &[T]) -> Vec<T> {
///
/// A `LexRequirement` instance, which is the requirement that satisfies all the
/// aggregate requirements. Returns an error in case of conflicting requirements.
fn get_finer_aggregate_exprs_requirement(
pub fn get_finer_aggregate_exprs_requirement(
aggr_exprs: &mut [Arc<dyn AggregateExpr>],
group_by: &PhysicalGroupBy,
eq_properties: &EquivalenceProperties,
Expand Down Expand Up @@ -998,7 +998,7 @@ fn get_finer_aggregate_exprs_requirement(
/// The expressions are different depending on `mode`:
/// * Partial: AggregateExpr::expressions
/// * Final: columns of `AggregateExpr::state_fields()`
fn aggregate_expressions(
pub fn aggregate_expressions(
aggr_expr: &[Arc<dyn AggregateExpr>],
mode: &AggregateMode,
col_idx_base: usize,
Expand Down Expand Up @@ -1051,9 +1051,9 @@ fn merge_expressions(
})
}

pub(crate) type AccumulatorItem = Box<dyn Accumulator>;
pub type AccumulatorItem = Box<dyn Accumulator>;

fn create_accumulators(
pub fn create_accumulators(
aggr_expr: &[Arc<dyn AggregateExpr>],
) -> Result<Vec<AccumulatorItem>> {
aggr_expr
Expand All @@ -1064,7 +1064,7 @@ fn create_accumulators(

/// returns a vector of ArrayRefs, where each entry corresponds to either the
/// final value (mode = Final, FinalPartitioned and Single) or states (mode = Partial)
fn finalize_aggregation(
pub fn finalize_aggregation(
accumulators: &mut [AccumulatorItem],
mode: &AggregateMode,
) -> Result<Vec<ArrayRef>> {
Expand Down
8 changes: 7 additions & 1 deletion datafusion/physical-plan/src/aggregates/order/full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use datafusion_expr::EmitTo;
/// `0..12` can be emitted. Note that `13` can not yet be emitted as
/// there may be more values in the next batch with the same group_id.
#[derive(Debug)]
pub(crate) struct GroupOrderingFull {
pub struct GroupOrderingFull {
state: State,
}

Expand Down Expand Up @@ -142,3 +142,9 @@ impl GroupOrderingFull {
std::mem::size_of::<Self>()
}
}

impl Default for GroupOrderingFull {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

fn default() -> Self {
Self::new()
}
}
8 changes: 4 additions & 4 deletions datafusion/physical-plan/src/aggregates/order/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ mod full;
mod partial;

use crate::InputOrderMode;
pub(crate) use full::GroupOrderingFull;
pub(crate) use partial::GroupOrderingPartial;
pub use full::GroupOrderingFull;
pub use partial::GroupOrderingPartial;

/// Ordering information for each group in the hash table
#[derive(Debug)]
pub(crate) enum GroupOrdering {
pub enum GroupOrdering {
/// Groups are not ordered
None,
/// Groups are ordered by some pre-set of the group keys
Expand Down Expand Up @@ -117,7 +117,7 @@ impl GroupOrdering {
}

/// Return the size of memory used by the ordering state, in bytes
pub(crate) fn size(&self) -> usize {
pub fn size(&self) -> usize {
std::mem::size_of::<Self>()
+ match self {
GroupOrdering::None => 0,
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/aggregates/order/partial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ use std::sync::Arc;
/// order) recent group index
///```
#[derive(Debug)]
pub(crate) struct GroupOrderingPartial {
pub struct GroupOrderingPartial {
/// State machine
state: State,

Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ struct FilterExecStream {
baseline_metrics: BaselineMetrics,
}

pub(crate) fn batch_filter(
pub fn batch_filter(
batch: &RecordBatch,
predicate: &Arc<dyn PhysicalExpr>,
) -> Result<RecordBatch> {
Expand Down