Enum tidb_query_datatype::codec::batch::LazyBatchColumn[][src]

pub enum LazyBatchColumn {
    Raw(BufferVec),
    Decoded(VectorValue),
}

A container stores an array of datums, which can be either raw (not decoded), or decoded into the VectorValue type.

TODO: Since currently the data format in response can be the same as in storage, we use this structure to avoid unnecessary repeated serialization / deserialization. In future, Coprocessor will respond all data in Chunk format which is different to the format in storage. At that time, this structure is no longer useful and should be removed.

Variants

Raw(BufferVec)
Decoded(VectorValue)

Implementations

impl LazyBatchColumn[src]

pub fn raw_with_capacity(capacity: usize) -> Self[src]

Creates a new LazyBatchColumn::Raw with specified capacity.

pub fn decoded_with_capacity_and_tp(capacity: usize, eval_tp: EvalType) -> Self[src]

Creates a new LazyBatchColumn::Decoded with specified capacity and eval type.

pub fn clone_empty(&self, capacity: usize) -> Self[src]

Creates a new empty LazyBatchColumn with the same schema.

pub fn is_raw(&self) -> bool[src]

pub fn is_decoded(&self) -> bool[src]

pub fn decoded(&self) -> &VectorValue[src]

pub fn mut_decoded(&mut self) -> &mut VectorValue[src]

pub fn raw(&self) -> &BufferVec[src]

pub fn mut_raw(&mut self) -> &mut BufferVec[src]

pub fn len(&self) -> usize[src]

pub fn truncate(&mut self, len: usize)[src]

pub fn clear(&mut self)[src]

pub fn is_empty(&self) -> bool[src]

pub fn capacity(&self) -> usize[src]

pub fn ensure_decoded(
    &mut self,
    ctx: &mut EvalContext,
    field_type: &FieldType,
    logical_rows: LogicalRows<'_>
) -> Result<()>
[src]

Decodes this column if the column is not decoded, according to the given logical rows map. After decoding, the decoded column will have the same physical layout as the encoded one (i.e. the same logical rows), but elements in unnecessary positions will not be decoded and will be None.

The field type is needed because we use the same DateTime structure when handling Date, Time or Timestamp.

pub fn ensure_all_decoded_for_test(
    &mut self,
    ctx: &mut EvalContext,
    field_type: &FieldType
) -> Result<()>
[src]

pub fn maximum_encoded_size(&self, logical_rows: &[usize]) -> usize[src]

Returns maximum encoded size.

pub fn maximum_encoded_size_chunk(&self, logical_rows: &[usize]) -> usize[src]

Returns maximum encoded size in chunk format.

pub fn encode(
    &self,
    row_index: usize,
    field_type: &impl FieldTypeAccessor,
    ctx: &mut EvalContext,
    output: &mut Vec<u8>
) -> Result<()>
[src]

Encodes into binary format.

pub fn encode_chunk(
    &self,
    ctx: &mut EvalContext,
    logical_rows: &[usize],
    field_type: &FieldType,
    output: &mut Vec<u8>
) -> Result<()>
[src]

Encodes into Chunk format.

Trait Implementations

impl Clone for LazyBatchColumn[src]

impl Debug for LazyBatchColumn[src]

impl From<VectorValue> for LazyBatchColumn[src]

Auto Trait Implementations

impl RefUnwindSafe for LazyBatchColumn

impl Send for LazyBatchColumn

impl Sync for LazyBatchColumn

impl Unpin for LazyBatchColumn

impl UnwindSafe for LazyBatchColumn

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<V, W> ConvertFrom<W> for V where
    W: ConvertTo<V>, 
[src]

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]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]