Struct datafusion_expr::logical_plan::Aggregate
source · #[non_exhaustive]pub struct Aggregate {
pub input: Arc<LogicalPlan>,
pub group_expr: Vec<Expr>,
pub aggr_expr: Vec<Expr>,
pub schema: DFSchemaRef,
}
Expand description
Aggregates its input based on a set of grouping and aggregate expressions (e.g. SUM).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.input: Arc<LogicalPlan>
The incoming logical plan
group_expr: Vec<Expr>
Grouping expressions
aggr_expr: Vec<Expr>
Aggregate expressions
schema: DFSchemaRef
The schema description of the aggregate output
Implementations§
source§impl Aggregate
impl Aggregate
sourcepub fn try_new(
input: Arc<LogicalPlan>,
group_expr: Vec<Expr>,
aggr_expr: Vec<Expr>,
) -> Result<Self>
pub fn try_new( input: Arc<LogicalPlan>, group_expr: Vec<Expr>, aggr_expr: Vec<Expr>, ) -> Result<Self>
Create a new aggregate operator.
sourcepub fn try_new_with_schema(
input: Arc<LogicalPlan>,
group_expr: Vec<Expr>,
aggr_expr: Vec<Expr>,
schema: DFSchemaRef,
) -> Result<Self>
pub fn try_new_with_schema( input: Arc<LogicalPlan>, group_expr: Vec<Expr>, aggr_expr: Vec<Expr>, schema: DFSchemaRef, ) -> Result<Self>
Create a new aggregate operator using the provided schema to avoid the overhead of building the schema again when the schema is already known.
This method should only be called when you are absolutely sure that the schema being provided is correct for the aggregate. If in doubt, call try_new instead.
sourcepub fn group_expr_len(&self) -> Result<usize>
pub fn group_expr_len(&self) -> Result<usize>
Get the length of the group by expression in the output schema This is not simply group by expression length. Expression may be GroupingSet, etc. In these case we need to get inner expression lengths.
Trait Implementations§
impl Eq for Aggregate
impl StructuralPartialEq for Aggregate
Auto Trait Implementations§
impl Freeze for Aggregate
impl !RefUnwindSafe for Aggregate
impl Send for Aggregate
impl Sync for Aggregate
impl Unpin for Aggregate
impl !UnwindSafe for Aggregate
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.