Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
RowLayout in datafusion::row::layout - Rust
[go: Go Back, main page]

pub struct RowLayout { /* private fields */ }
Expand description

Row layout stores one or multiple 8-byte word(s) per field for CPU-friendly and efficient processing.

It is mainly used to represent the rows with frequently updated content, for example, grouping state for hash aggregation.

Each tuple consists of two parts: “null bit set” and “values”.

For null-free tuples, the null bit set can be omitted.

The null bit set, when present, is aligned to 8 bytes. It stores one bit per field.

In the region of the values, we store the fields in the order they are defined in the schema. Each field is stored in one or multiple 8-byte words.

┌─────────────────┬─────────────────────┐
│Validity Bitmask │      Fields         │
│ (8-byte aligned)│   (8-byte words)    │
└─────────────────┴─────────────────────┘

For example, given the schema (Int8, Float32, Int64) with a null-free tuple

Encoding the tuple (1, 3.14, 42)

Requires 24 bytes (3 fields * 8 bytes each):

┌──────────────────────┬──────────────────────┬──────────────────────┐
│         0x01         │      0x4048F5C3      │      0x0000002A      │
└──────────────────────┴──────────────────────┴──────────────────────┘
0                      8                      16                     24

If the schema allows null values and the tuple is (1, NULL, 42)

Encoding the tuple requires 32 bytes (1 * 8 bytes for the null bit set + 3 fields * 8 bytes each):

┌──────────────────────────┬──────────────────────┬──────────────────────┬──────────────────────┐
│       0b00000101         │         0x01         │      0x00000000      │      0x0000002A      │
│ (7 bytes padding after)  │                      │                      │                      │
└──────────────────────────┴──────────────────────┴──────────────────────┴──────────────────────┘
0                          8                      16                     24                     32

Implementations§

source§

impl RowLayout

source

pub fn new(schema: &Schema) -> RowLayout

new

source

pub fn fixed_part_width(&self) -> usize

Get fixed part width for this layout

Trait Implementations§

source§

impl Clone for RowLayout

source§

fn clone(&self) -> RowLayout

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RowLayout

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> Allocation for Twhere T: RefUnwindSafe + Send + Sync,