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: impl Into<String>, gen: Box<dyn ArrayGenerator>) -> Self
pub fn col(self, name: impl Into<String>, gen: Box<dyn ArrayGenerator>) -> Self
Adds a new column to the generator
See crate::generator::array
for methods to create generators
Sourcepub fn anon_col(self, gen: Box<dyn ArrayGenerator>) -> Self
pub fn anon_col(self, gen: Box<dyn ArrayGenerator>) -> Self
Adds a new column to the generator with a generated unique name
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)
pub fn into_reader_stream( self, batch_size: RowCount, num_batches: BatchCount, ) -> BoxStream<'static, Result<RecordBatch, ArrowError>>
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 Freeze for BatchGeneratorBuilder
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