pub(crate) struct OrderSensitiveArrayAggAccumulator {
values: Vec<ScalarValue>,
ordering_values: Vec<Vec<ScalarValue>>,
datatypes: Vec<DataType>,
ordering_req: LexOrdering,
is_input_pre_ordered: bool,
reverse: bool,
ignore_nulls: bool,
}Expand description
Accumulator for a ARRAY_AGG(... ORDER BY ..., ...) aggregation. In a multi
partition setting, partial aggregations are computed for every partition,
and then their results are merged.
Fields§
§values: Vec<ScalarValue>Stores entries in the ARRAY_AGG result.
ordering_values: Vec<Vec<ScalarValue>>Stores values of ordering requirement expressions corresponding to each
entry in values. This information is used when merging results from
different partitions. For detailed information how merging is done, see
merge_ordered_arrays.
datatypes: Vec<DataType>Stores datatypes of expressions inside values and ordering requirement expressions.
ordering_req: LexOrderingStores the ordering requirement of the Accumulator.
is_input_pre_ordered: boolWhether the input is known to be pre-ordered
reverse: boolWhether the aggregation is running in reverse.
ignore_nulls: boolWhether the aggregation should ignore null values.
Implementations§
Source§impl OrderSensitiveArrayAggAccumulator
impl OrderSensitiveArrayAggAccumulator
Sourcepub fn try_new(
datatype: &DataType,
ordering_dtypes: &[DataType],
ordering_req: LexOrdering,
is_input_pre_ordered: bool,
reverse: bool,
ignore_nulls: bool,
) -> Result<Self>
pub fn try_new( datatype: &DataType, ordering_dtypes: &[DataType], ordering_req: LexOrdering, is_input_pre_ordered: bool, reverse: bool, ignore_nulls: bool, ) -> Result<Self>
Create a new order-sensitive ARRAY_AGG accumulator based on the given item data type.
fn sort(&mut self)
fn evaluate_orderings(&self) -> Result<ScalarValue>
Trait Implementations§
Source§impl Accumulator for OrderSensitiveArrayAggAccumulator
impl Accumulator for OrderSensitiveArrayAggAccumulator
Source§fn update_batch(&mut self, values: &[ArrayRef]) -> Result<()>
fn update_batch(&mut self, values: &[ArrayRef]) -> Result<()>
Source§fn merge_batch(&mut self, states: &[ArrayRef]) -> Result<()>
fn merge_batch(&mut self, states: &[ArrayRef]) -> Result<()>
Array containing one
or more intermediate values. Read moreSource§fn state(&mut self) -> Result<Vec<ScalarValue>>
fn state(&mut self) -> Result<Vec<ScalarValue>>
Source§fn evaluate(&mut self) -> Result<ScalarValue>
fn evaluate(&mut self) -> Result<ScalarValue>
Source§fn size(&self) -> usize
fn size(&self) -> usize
Self. Read more§fn retract_batch(
&mut self,
_values: &[Arc<dyn Array>],
) -> Result<(), DataFusionError>
fn retract_batch( &mut self, _values: &[Arc<dyn Array>], ) -> Result<(), DataFusionError>
§fn supports_retract_batch(&self) -> bool
fn supports_retract_batch(&self) -> bool
Auto Trait Implementations§
impl Freeze for OrderSensitiveArrayAggAccumulator
impl !RefUnwindSafe for OrderSensitiveArrayAggAccumulator
impl Send for OrderSensitiveArrayAggAccumulator
impl Sync for OrderSensitiveArrayAggAccumulator
impl Unpin for OrderSensitiveArrayAggAccumulator
impl !UnwindSafe for OrderSensitiveArrayAggAccumulator
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more