pub struct LocateOnly {
pub row_count: usize,
pub field_count: usize,
pub distinct_fields: FxHashSet<String>,
/* private fields */
}Expand description
A zero-allocation sink that counts rows and fields without decoding or storing any values. Use this to measure the cost of the scan + locate phase independently from extract + store.
Fields§
§row_count: usize§field_count: usize§distinct_fields: FxHashSet<String>Implementations§
Source§impl LocateOnly
impl LocateOnly
pub fn new(plan: ExecutionPlan) -> Self
Sourcepub fn total_fields(&self) -> usize
pub fn total_fields(&self) -> usize
Total fields seen across all rows.
Sourcepub fn num_distinct_fields(&self) -> usize
pub fn num_distinct_fields(&self) -> usize
Number of distinct field names encountered.
Trait Implementations§
Source§impl ColumnarSink for LocateOnly
impl ColumnarSink for LocateOnly
fn begin_row(&mut self)
fn put_field(&mut self, name: &str, _value: Value<'_>)
fn end_row(&mut self)
Source§fn wants(&self, _name: &str) -> bool
fn wants(&self, _name: &str) -> bool
Return
false to signal that the engine will drop this field.Source§fn needs_value(&self) -> bool
fn needs_value(&self) -> bool
Whether this sink needs decoded values from the parser. Read more
Source§fn resolve<'a>(&'a self, name: &'a str) -> Option<&'a str>
fn resolve<'a>(&'a self, name: &'a str) -> Option<&'a str>
Resolve a raw field name to its output column name, or
None if dropped.
Default keeps the name as-is. Adapters that do expensive extraction can
call this once and then put_field_resolved to avoid a second
resolve_field inside put_field.Source§fn finish(&mut self) -> Result<RecordBatch>
fn finish(&mut self) -> Result<RecordBatch>
Finalize the sink into an Arrow
RecordBatch.Source§fn resolve_raw<'a>(&'a self, raw_name: &'a [u8]) -> Option<&'a str>
fn resolve_raw<'a>(&'a self, raw_name: &'a [u8]) -> Option<&'a str>
Resolve a valid raw name without allocating a UTF-8
String.Source§fn resolve_and_put_raw(&mut self, raw_name: &[u8], value: Value<'_>)
fn resolve_and_put_raw(&mut self, raw_name: &[u8], value: Value<'_>)
Push a value for a field whose name is still in its raw byte form.
Source§fn put_field_resolved(&mut self, resolved_name: &str, value: Value<'_>)
fn put_field_resolved(&mut self, resolved_name: &str, value: Value<'_>)
Push a field that has already been resolved via
resolve.
Default delegates to put_field (which will resolve again). Overrides
should bypass the rename/drop lookup.Source§fn put_field_at(&mut self, _slot: u32, value: Value<'_>)
fn put_field_at(&mut self, _slot: u32, value: Value<'_>)
Push a value directly to a known slot index, bypassing all name
resolution, hash lookups, and attribute scanning. Used by adapters
that have verified the field identity via
expect_slot + memcmp. Read moreSource§fn resolve_and_put(&mut self, name: &str, value: Value<'_>)
fn resolve_and_put(&mut self, name: &str, value: Value<'_>)
Resolve a field name and push it in one call, avoiding the double
resolve_field that wants + put_field would perform.
Default: resolve then put_field_resolved (with owned clone to satisfy
the borrow checker). Overrides should avoid the allocation.Source§fn row_rejected(&self) -> bool
fn row_rejected(&self) -> bool
Whether the current row has been rejected by the filter and the scanner
should skip the remainder of the row. Used for predicate-first
deferred materialization: once
Fail, the scanner can byte-jump to
</Details> without further field scanning. Default false.Source§fn row_satisfied(&self) -> bool
fn row_satisfied(&self) -> bool
Whether every wanted column for the current row already has a value.
The adapter can byte-jump to the row close tag when this returns true,
skipping remaining fields. Composes with
row_rejected (a row can
be satisfied OR rejected, both short-circuit). Read moreSource§fn wanted_mask(&self) -> u64
fn wanted_mask(&self) -> u64
Bitmask of columns that the projection wants. Bit
i is set iff
column i is in the output schema. The adapter can test membership
with (wanted_mask >> slot) & 1 == 1 instead of a virtual call per
field. Returns empty mask (all zeros) when no projection is active.Source§fn expect_slot(&self, _ordinal: u32) -> Option<(u32, &[u8])>
fn expect_slot(&self, _ordinal: u32) -> Option<(u32, &[u8])>
After the layout is learned, the expected (slot, raw name bytes) at
this ordinal position in the record. The adapter can compare the
raw bytes in-place (one memcmp) instead of running the full
attribute scan → UTF-8 decode → hash → lookup path. Read more
Source§fn record_slot(&mut self, _ordinal: u32, _slot: u32, _raw_name: &[u8])
fn record_slot(&mut self, _ordinal: u32, _slot: u32, _raw_name: &[u8])
Adapter reports the slot it resolved for
ordinal so the engine
can cache it for subsequent rows. Called after the adapter resolves
a field via the generic path (wants + resolve + put_field_resolved).Source§fn layout_broken(&mut self, _ordinal: u32)
fn layout_broken(&mut self, _ordinal: u32)
Adapter reports that the layout expected at
ordinal did not match.
The engine should invalidate its cached expectation and fall back to
generic resolution for subsequent rows.Source§fn reset_child_ordinal(&mut self)
fn reset_child_ordinal(&mut self)
Reset the ordinal counter for child-element tracking. Called after
row-tag attributes are emitted so child ordinals start at 0.
Auto Trait Implementations§
impl Freeze for LocateOnly
impl RefUnwindSafe for LocateOnly
impl Send for LocateOnly
impl Sync for LocateOnly
impl Unpin for LocateOnly
impl UnsafeUnpin for LocateOnly
impl UnwindSafe for LocateOnly
Blanket Implementations§
impl<T> Allocation for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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