Uploaded product enrichment
An uploaded product list enriched with generated columns.
- Languages
eng- Formats
csv
Recipe
gbddl 1
language eng
table products dataset(@products) (
sku text primarykey pick(@products.sku)
name text pick(@products.name)
price decimal(10, 2) pick(@products.price)
)
table price_adjustments rows 30 (
id int64 autoincrement primarykey
sku text same(up) pick(@products.sku)
name text same(up) pick(@products.name)
multiplier decimal(4, 2) decimal(min: 0.8, max: 1.2)
listed_at date date(min: "2023-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
Uploaded product enrichment
A multi-table recipe that starts from an uploaded product list and enriches it with generated columns.
What it demonstrates
- Dataset table —
productsis adataset(@products)table, so each row reads one row of the uploadedproductspart. - Upload pick —
pick(@products.sku),pick(@products.name)andpick(@products.price)read columns of the upload. - Upload coherence —
price_adjustmentsgroupsskuandnameundersame(up), so the two columns read the same upload row.
Prerequisites
This recipe needs an uploaded part named products. The committed
inputs/products.csv fixture supplies it; provide your own file with columns
sku, name and price to adapt it.
Run it
Submit the recipe body to POST /api/v1/jobs?input_format=gbddl together with
the products upload, or run the repository's local runner (run by
task test), which reads inputs/products.csv.
The recipe outputs CSV files: products.csv and price_adjustments.csv.
Guarantees
Each products row matches one upload row; sku is unique; and each
price_adjustments row reads one coherent upload row for its sku and name.
Tested features
Smart types, physical types, rules and formats this recipe exercises and verifies.
pickdecimaldatetable:datasetsame:uploadprimary-keyautoincrement