pub struct TpchGenerator { /* private fields */ }Expand description
TPC-H data generator
The main entry point for generating TPC-H benchmark data.
Use the builder pattern via TpchGenerator::builder() to configure and create instances.
§Examples
use tpchgen_cli::{TpchGenerator, Table, OutputFormat};
use std::path::PathBuf;
use ::parquet::basic::ZstdLevel;
// Generate all tables at scale factor 1 in TBL format
TpchGenerator::builder()
.with_scale_factor(1.0)
.with_output_dir(PathBuf::from("./data"))
.build()
.generate()
.await?;
// Generate specific tables in Parquet format with compression
TpchGenerator::builder()
.with_scale_factor(10.0)
.with_output_dir(PathBuf::from("./benchmark_data"))
.with_tables(vec![Table::Orders, Table::Lineitem])
.with_format(OutputFormat::Parquet)
.with_parquet_compression(tpchgen_cli::Compression::ZSTD(ZstdLevel::try_new(1).unwrap()))
.with_num_threads(16)
.build()
.generate()
.await?;Implementations§
Source§impl TpchGenerator
impl TpchGenerator
Sourcepub fn builder() -> TpchGeneratorBuilder
pub fn builder() -> TpchGeneratorBuilder
Create a new builder for configuring the generator
This is the recommended way to construct a TpchGenerator.
§Examples
use tpchgen_cli::TpchGenerator;
let generator = TpchGenerator::builder()
.with_scale_factor(1.0)
.build();Sourcepub async fn generate(self) -> Result<()>
pub async fn generate(self) -> Result<()>
Generate TPC-H data with the configured settings
This async method performs the actual data generation, creating files in the configured output directory (or writing to stdout if configured).
§Returns
Ok(())on successful generationErr(io::Error)if file I/O or generation fails
§Examples
use tpchgen_cli::TpchGenerator;
TpchGenerator::builder()
.with_scale_factor(1.0)
.build()
.generate()
.await?;Auto Trait Implementations§
impl !RefUnwindSafe for TpchGenerator
impl !UnwindSafe for TpchGenerator
impl Freeze for TpchGenerator
impl Send for TpchGenerator
impl Sync for TpchGenerator
impl Unpin for TpchGenerator
impl UnsafeUnpin for TpchGenerator
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