Skip to content

Exact null behavior

Columns with different null fractions, showing exact null placement.

simple volume small NullsPeople
Languages
eng
Formats
csv

Recipe

recipe.gbddl
gbddl 1
language eng

table nullable_records rows 24 (
  id        int64 autoincrement primarykey
  always    text words(maxWords: 2)
  sometimes text null(25%) words(maxWords: 2)
  half      text null(50%) words(maxWords: 2)
  mostly    text null(75%) words(maxWords: 2)
  optional  int64 null integer(min: 1, max: 99)
  maybe_d   date null(20%) date(min: "2020-01-01", max: "2024-12-31")
)

output csv

This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.

About this recipe

Nullable records

A single-table recipe that shows exact null behavior: columns with different null fractions, from always present to always null.

What it demonstrates

  • Null fractions — sometimes is null 25% of the time, half 50%, mostly 75%, and optional always null.
  • Typed nulls — optional is a nullable integer and maybe_d a nullable date at 20%.

Run it

Submit the recipe body to POST /api/v1/jobs?input_format=gbddl, or paste it into Chef, to generate the data. The repository's local runner (run by task test) also generates it and verifies its output.

The recipe outputs one CSV table file, nullable_records.csv, holding twenty-four rows.

Guarantees

The exact null count of each column matches its declared fraction, verified by the runner. Other values are synthetic.

Tested features

Smart types, physical types, rules and formats this recipe exercises and verifies.

wordsintegerdatenullautoincrementprimary-key