risingwave_common::array::data_chunk

Trait DataChunkTestExt

source
pub trait DataChunkTestExt {
    const SEED: u64 = 18_403_958_415_801_939_711u64;

    // Required methods
    fn from_pretty(s: &str) -> Self;
    fn with_invisible_holes(self) -> Self
       where Self: Sized;
    fn assert_valid(&self);
    fn gen_data_chunk(
        chunk_offset: usize,
        chunk_size: usize,
        data_types: &[DataType],
        string_properties: &VarcharProperty,
        visibility_ratio: f64,
    ) -> Self;
    fn gen_data_chunks(
        num_of_chunks: usize,
        chunk_size: usize,
        data_types: &[DataType],
        string_properties: &VarcharProperty,
        visibility_ratio: f64,
    ) -> Vec<Self>
       where Self: Sized;
}
Expand description

Test utilities for DataChunk.

Provided Associated Constants§

source

const SEED: u64 = 18_403_958_415_801_939_711u64

SEED for generating data chunk.

Required Methods§

source

fn from_pretty(s: &str) -> Self

Parse a chunk from string.

§Format

The first line is a header indicating the column types. The following lines indicate rows within the chunk. Each line starts with an operation followed by values. NULL values are represented as ..

§Example
use risingwave_common::array::{DataChunk, DataChunkTestExt};
let chunk = DataChunk::from_pretty(
    "I I I I      // type chars
     2 5 . .      // '.' means NULL
     2 5 2 6 D    // 'D' means deleted in visibility
     . . 4 8      // ^ comments are ignored
     . . 3 4",
);

// type chars:
//     B: bool
//     I: i64
//     i: i32
//     F: f64
//     f: f32
//     T: str
//    TS: Timestamp
//   SRL: Serial
// <i,f>: struct
source

fn with_invisible_holes(self) -> Self
where Self: Sized,

Insert one invisible hole after every record.

source

fn assert_valid(&self)

Panic if the chunk is invalid.

source

fn gen_data_chunk( chunk_offset: usize, chunk_size: usize, data_types: &[DataType], string_properties: &VarcharProperty, visibility_ratio: f64, ) -> Self

Generate data chunk when supplied with chunk_size and column data types.

source

fn gen_data_chunks( num_of_chunks: usize, chunk_size: usize, data_types: &[DataType], string_properties: &VarcharProperty, visibility_ratio: f64, ) -> Vec<Self>
where Self: Sized,

Generate data chunks when supplied with chunk_size and column data types.

Object Safety§

This trait is not object safe.

Implementors§