Struct tidb_query_executors::top_n_executor::BatchTopNExecutor [−][src]
Fields
heap: BinaryHeap<HeapItemUnsafe>
The heap, which contains N rows at most.
This field is placed before eval_columns_buffer_unsafe
, order_exprs
, order_is_desc
and src
because it relies on data in those fields and we want this field to be dropped
first.
eval_columns_buffer_unsafe: Box<Vec<RpnStackNode<'static>>>
A collection of all evaluated columns. This is to avoid repeated allocations in
each next_batch()
.
DO NOT EVER try to read the content of the elements directly, since it is highly unsafe. The lifetime of elements is not really ’static. Certain elements are valid only if both of the following conditions are satisfied:
-
BatchTopNExecutor
is valid (i.e. not dropped). -
The referenced
LazyBatchColumnVec
of the element must be valid, which only happens when at least one of the row is in theheap
. Note that rows may be swapped out fromheap
at any time.
This field is placed before order_exprs
and src
because it relies on data in
those fields and we want this field to be dropped first.
order_exprs: Box<[RpnExpression]>
order_exprs_field_type: Box<[FieldType]>
This field stores the field type of the results evaluated by the exprs in order_exprs
.
order_is_desc: Box<[bool]>
Whether or not it is descending order for each order by column.
n: usize
context: EvalContext
src: Src
is_ended: bool
Implementations
impl BatchTopNExecutor<Box<dyn BatchExecutor<StorageStats = ()>>>
[src][−]
pub fn check_supported(descriptor: &TopN) -> Result<()>
[src][−]
Checks whether this executor can be used.
impl<Src: BatchExecutor> BatchTopNExecutor<Src>
[src][−]
pub fn new(
config: Arc<EvalConfig>,
src: Src,
order_exprs_def: Vec<Expr>,
order_is_desc: Vec<bool>,
n: usize
) -> Result<Self>
[src]
config: Arc<EvalConfig>,
src: Src,
order_exprs_def: Vec<Expr>,
order_is_desc: Vec<bool>,
n: usize
) -> Result<Self>
fn handle_next_batch(&mut self) -> Result<Option<LazyBatchColumnVec>>
[src]
fn process_batch_input(
&mut self,
physical_columns: LazyBatchColumnVec,
logical_rows: Vec<usize>
) -> Result<()>
[src]
&mut self,
physical_columns: LazyBatchColumnVec,
logical_rows: Vec<usize>
) -> Result<()>
fn heap_add_row(&mut self, row: HeapItemUnsafe) -> Result<()>
[src]
fn heap_take_all(&mut self) -> LazyBatchColumnVec
[src]
Trait Implementations
impl<Src: BatchExecutor> BatchExecutor for BatchTopNExecutor<Src>
[src][+]
impl<Src: BatchExecutor> Send for BatchTopNExecutor<Src>
[src]
All NonNull
pointers in BatchTopNExecutor
cannot be accessed out of the struct and
BatchTopNExecutor
doesn’t leak the pointers to other threads. Therefore, with those NonNull
pointers, BatchTopNExecutor still remains Send
.
Auto Trait Implementations
impl<Src> !RefUnwindSafe for BatchTopNExecutor<Src>
impl<Src> !Sync for BatchTopNExecutor<Src>
impl<Src> Unpin for BatchTopNExecutor<Src> where
Src: Unpin,
Src: Unpin,
impl<Src> !UnwindSafe for BatchTopNExecutor<Src>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<V, W> ConvertFrom<W> for V where
W: ConvertTo<V>,
[src][+]
W: ConvertTo<V>,
impl<T> From<T> for T
[src][+]
impl<T> Instrument for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> Pointable for T
[src][+]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src][+]
V: MultiLane<T>,