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§
Required Methods§
sourcefn from_pretty(s: &str) -> Self
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
sourcefn with_invisible_holes(self) -> Selfwhere
Self: Sized,
fn with_invisible_holes(self) -> Selfwhere
Self: Sized,
Insert one invisible hole after every record.
sourcefn assert_valid(&self)
fn assert_valid(&self)
Panic if the chunk is invalid.
sourcefn gen_data_chunk(
chunk_offset: usize,
chunk_size: usize,
data_types: &[DataType],
string_properties: &VarcharProperty,
visibility_ratio: f64,
) -> Self
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.
sourcefn gen_data_chunks(
num_of_chunks: usize,
chunk_size: usize,
data_types: &[DataType],
string_properties: &VarcharProperty,
visibility_ratio: f64,
) -> Vec<Self>where
Self: Sized,
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.