pub struct SortedSearch {
partition_by_sort_keys: Vec<PhysicalSortExpr>,
ordered_partition_by_indices: Vec<usize>,
input_schema: SchemaRef,
}Expand description
This object encapsulates the algorithm state for sorted searching when computing partitions.
Fields§
§partition_by_sort_keys: Vec<PhysicalSortExpr>Stores partition by columns and their ordering information
ordered_partition_by_indices: Vec<usize>Input ordering and partition by key ordering need not be the same, so this vector stores the mapping between them. For instance, if the input is ordered by a, b and the window expression contains a PARTITION BY b, a clause, this attribute stores [1, 0].
input_schema: SchemaRefImplementations§
Source§impl SortedSearch
impl SortedSearch
Sourcefn calculate_n_out_row(
&mut self,
window_agg_states: &[PartitionWindowAggStates],
partition_buffers: &mut PartitionBatches,
) -> usize
fn calculate_n_out_row( &mut self, window_agg_states: &[PartitionWindowAggStates], partition_buffers: &mut PartitionBatches, ) -> usize
Calculates how many rows we can output.
Trait Implementations§
Source§impl PartitionSearcher for SortedSearch
impl PartitionSearcher for SortedSearch
Source§fn calculate_out_columns(
&mut self,
_input_buffer: &RecordBatch,
window_agg_states: &[PartitionWindowAggStates],
partition_buffers: &mut PartitionBatches,
_window_expr: &[Arc<dyn WindowExpr>],
) -> Result<Option<Vec<ArrayRef>>>
fn calculate_out_columns( &mut self, _input_buffer: &RecordBatch, window_agg_states: &[PartitionWindowAggStates], partition_buffers: &mut PartitionBatches, _window_expr: &[Arc<dyn WindowExpr>], ) -> Result<Option<Vec<ArrayRef>>>
This method constructs new output columns using the result of each window expression.
fn evaluate_partition_batches( &mut self, record_batch: &RecordBatch, _window_expr: &[Arc<dyn WindowExpr>], ) -> Result<Vec<(PartitionKey, RecordBatch)>>
Source§fn mark_partition_end(&self, partition_buffers: &mut PartitionBatches)
fn mark_partition_end(&self, partition_buffers: &mut PartitionBatches)
Marks the partition as done if we are sure that corresponding partition
cannot receive any more values.
fn input_schema(&self) -> &SchemaRef
Source§fn is_mode_linear(&self) -> bool
fn is_mode_linear(&self) -> bool
Determine whether
[InputOrderMode] is [InputOrderMode::Linear] or not.Source§fn update_partition_batch(
&mut self,
input_buffer: &mut RecordBatch,
record_batch: RecordBatch,
window_expr: &[Arc<dyn WindowExpr>],
partition_buffers: &mut PartitionBatches,
) -> Result<()>
fn update_partition_batch( &mut self, input_buffer: &mut RecordBatch, record_batch: RecordBatch, window_expr: &[Arc<dyn WindowExpr>], partition_buffers: &mut PartitionBatches, ) -> Result<()>
Updates
input_buffer and partition_buffers with the new record_batch.Auto Trait Implementations§
impl Freeze for SortedSearch
impl !RefUnwindSafe for SortedSearch
impl Send for SortedSearch
impl Sync for SortedSearch
impl Unpin for SortedSearch
impl !UnwindSafe for SortedSearch
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
§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>
Converts
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>
Converts
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