Struct lance_datagen::generator::BatchGeneratorBuilder
source · pub struct BatchGeneratorBuilder { /* private fields */ }Expand description
A builder to create a record batch reader with generated data
This type is meant to be used in a fluent builder style to define the schema and generators for a record batch reader.
Implementations§
source§impl BatchGeneratorBuilder
impl BatchGeneratorBuilder
sourcepub fn new_with_seed(seed: Seed) -> Self
pub fn new_with_seed(seed: Seed) -> Self
Create a new BatchGeneratorBuilder with the given seed
sourcepub fn col(self, name: Option<String>, gen: Box<dyn ArrayGenerator>) -> Self
pub fn col(self, name: Option<String>, gen: Box<dyn ArrayGenerator>) -> Self
Adds a new column to the generator
See crate::generator::array for methods to create generators
pub fn into_batch_rows( self, batch_size: RowCount ) -> Result<RecordBatch, ArrowError>
pub fn into_batch_bytes( self, batch_size: ByteCount, rounding: RoundingBehavior ) -> Result<RecordBatch, ArrowError>
sourcepub fn into_reader_rows(
self,
batch_size: RowCount,
num_batches: BatchCount
) -> impl RecordBatchReader
pub fn into_reader_rows( self, batch_size: RowCount, num_batches: BatchCount ) -> impl RecordBatchReader
Create a RecordBatchReader that generates batches of the given size (in rows)
sourcepub fn into_reader_bytes(
self,
batch_size_bytes: ByteCount,
num_batches: BatchCount,
rounding: RoundingBehavior
) -> Result<impl RecordBatchReader, ArrowError>
pub fn into_reader_bytes( self, batch_size_bytes: ByteCount, num_batches: BatchCount, rounding: RoundingBehavior ) -> Result<impl RecordBatchReader, ArrowError>
Create a RecordBatchReader that generates batches of the given size (in bytes)
sourcepub fn with_random_nulls(&mut self, default_null_probability: f64)
pub fn with_random_nulls(&mut self, default_null_probability: f64)
Adds nulls (with the given probability) to all columns
Trait Implementations§
source§impl Default for BatchGeneratorBuilder
impl Default for BatchGeneratorBuilder
source§fn default() -> BatchGeneratorBuilder
fn default() -> BatchGeneratorBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for BatchGeneratorBuilder
impl Send for BatchGeneratorBuilder
impl Sync for BatchGeneratorBuilder
impl Unpin for BatchGeneratorBuilder
impl !UnwindSafe for BatchGeneratorBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more