TpchGeneratorBuilder

Struct TpchGeneratorBuilder 

Source
pub struct TpchGeneratorBuilder { /* private fields */ }
Expand description

Builder for constructing a TpchGenerator

Provides a fluent interface for configuring TPC-H data generation parameters. All builder methods can be chained, and calling build() produces a TpchGenerator ready to generate data.

§Defaults

  • Scale factor: 1.0
  • Output directory: current directory (“.”)
  • Tables: all 8 tables
  • Format: TBL
  • Threads: number of CPUs
  • Parquet compression: SNAPPY
  • Row group size: 7MB

§Examples

use tpchgen_cli::{TpchGenerator, Table, OutputFormat, Compression};
use std::path::PathBuf;
use ::parquet::basic::ZstdLevel;

let generator = TpchGenerator::builder()
    .with_scale_factor(100.0)
    .with_output_dir(PathBuf::from("/data/tpch"))
    .with_tables(vec![Table::Lineitem, Table::Orders])
    .with_format(OutputFormat::Parquet)
    .with_parquet_compression(Compression::ZSTD(ZstdLevel::try_new(3).unwrap()))
    .with_num_threads(32)
    .build();

generator.generate().await?;

Implementations§

Source§

impl TpchGeneratorBuilder

Source

pub fn new() -> Self

Create a new builder with default configuration

§Examples
use tpchgen_cli::TpchGeneratorBuilder;

let builder = TpchGeneratorBuilder::new();
Source

pub fn scale_factor(&self) -> f64

Returns the scale factor.

Source

pub fn with_scale_factor(self, scale_factor: f64) -> Self

Set the scale factor (e.g., 1.0 for 1GB, 10.0 for 10GB)

Source

pub fn with_output_dir(self, output_dir: impl Into<PathBuf>) -> Self

Set the output directory

Source

pub fn with_tables(self, tables: Vec<Table>) -> Self

Set which tables to generate (default: all tables)

Source

pub fn with_format(self, format: OutputFormat) -> Self

Set the output format (default: TBL)

Source

pub fn with_num_threads(self, num_threads: usize) -> Self

Set the number of threads for parallel generation (default: number of CPUs)

Source

pub fn with_parquet_compression(self, compression: Compression) -> Self

Set Parquet compression format (default: SNAPPY)

Source

pub fn with_parquet_row_group_bytes(self, bytes: i64) -> Self

Set target row group size in bytes for Parquet files (default: 7MB)

Source

pub fn with_parts(self, parts: i32) -> Self

Set the number of partitions to generate

Source

pub fn with_part(self, part: i32) -> Self

Set the specific partition to generate (1-based, requires parts to be set)

Source

pub fn with_stdout(self, stdout: bool) -> Self

Write output to stdout instead of files

Source

pub fn build(self) -> TpchGenerator

Build the TpchGenerator with the configured settings

Trait Implementations§

Source§

impl Clone for TpchGeneratorBuilder

Source§

fn clone(&self) -> TpchGeneratorBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TpchGeneratorBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TpchGeneratorBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,