tree: dfcb6f189098a54c2ed7a7cdaf9856332b387e16
  1. data/
  2. src/
  3. Cargo.toml
  4. README.md
crates/test/README.md

The test crate

This is a crate meant for facilitating testing in hudi-rs - it provides utilities and test data.

The data/ directory contains fully prepared sample Hudi tables categorized by table version and configuration options: each zipped file contains the Hudi table and the corresponding .sql contains the SQL used to generate the table.

Beside the table directory, a zip may also carry what Hudi's own reader returns for it, so this crate can be diffed against the reference implementation rather than against its own expectations:

DirectoryContentsRegenerated by
gold_data/Spark SELECT * snapshot(per fixture, ad hoc)
gold_options/one snapshot per read-option case (projection, read-optimized, incremental window), plus manifest.json naming themmor/avro/gold_options.scala
gold_incremental/one snapshot per incremental windowthe fixture's .gold.scala

gold_options/manifest.json is written by the generator and only ever read by the tests — the cases are derived from each fixture's own schema and hoodie.properties, so which cases a fixture ships varies (a table declaring no ordering field has no drop_ordering case). Never hand-edit a manifest; rerun the generator. See crates/test/src/gold_options.rs and the header comment in gold_options.scala for how to run it.

Enums in src/lib.rs like QuickstartTripsTable and SampleTable are for conveniently accessing these ready-made tables in tests. They take care of the unzipping and hand over the table paths to callers.