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]

datafusion_row::layout

Struct RowLayout

Source
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) -> Self

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

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