Skip to content

Commit 1cfdd4a

Browse files
committed
fix(duckshop): declare the columns staging models output and downstream models read
Sixteen staging models output source_seq and source_loaded_at, and some a payload column, that their MODEL headers did not declare, although downstream models read them. Declaring them makes each declared schema cover what its readers use, so tables created from the declarations support every downstream model. Compiled SQL is unchanged.
1 parent 60ca747 commit 1cfdd4a

16 files changed

Lines changed: 45 additions & 0 deletions

‎benchmarks/duckshop/project/models/staging/catalogue/stg_product_variants.sql‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ MODEL (
1111
is_fragile (type BOOLEAN),
1212
pack_size (type INT),
1313
attributes (type OBJECT),
14+
barcodes (type ARRAY),
15+
source_seq (type NUMBER(38, 0), nullable false),
16+
source_loaded_at (type TIMESTAMP_NTZ, nullable false),
1417
),
1518
);
1619

‎benchmarks/duckshop/project/models/staging/catalogue/stg_products.sql‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ MODEL (
1515
is_active (type BOOLEAN),
1616
spec_key_count (type INT),
1717
specs (type OBJECT),
18+
source_seq (type NUMBER(38, 0), nullable false),
19+
source_loaded_at (type TIMESTAMP_NTZ, nullable false),
1820
),
1921
);
2022

‎benchmarks/duckshop/project/models/staging/catalogue/stg_suppliers.sql‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ MODEL (
99
primary_contact_email (type VARCHAR),
1010
contact_count (type INT),
1111
payment_terms (type OBJECT),
12+
source_seq (type NUMBER(38, 0), nullable false),
13+
source_loaded_at (type TIMESTAMP_NTZ, nullable false),
1214
),
1315
);
1416

‎benchmarks/duckshop/project/models/staging/growth/stg_campaigns.sql‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ MODEL (
1212
target_regions (type ARRAY),
1313
target_age_min (type INT),
1414
target_age_max (type INT),
15+
source_seq (type NUMBER(38, 0), nullable false),
16+
source_loaded_at (type TIMESTAMP_NTZ, nullable false),
1517
),
1618
);
1719

‎benchmarks/duckshop/project/models/staging/inventory/stg_purchase_orders.sql‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ MODEL (
1010
expected_at (type TIMESTAMP_TZ),
1111
received_at (type TIMESTAMP_TZ),
1212
line_count (type INT),
13+
lines (type ARRAY),
14+
source_seq (type NUMBER(38, 0), nullable false),
15+
source_loaded_at (type TIMESTAMP_NTZ, nullable false),
1316
),
1417
);
1518

‎benchmarks/duckshop/project/models/staging/inventory/stg_warehouses.sql‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ MODEL (
1111
supports_same_day (type BOOLEAN),
1212
supports_cold_chain (type BOOLEAN),
1313
max_parcel_kg (type NUMBER(6, 2)),
14+
source_seq (type NUMBER(38, 0), nullable false),
15+
source_loaded_at (type TIMESTAMP_NTZ, nullable false),
1416
),
1517
);
1618

‎benchmarks/duckshop/project/models/staging/partners/stg_partner_listings.sql‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ MODEL (
99
commission_pct (type NUMBER(5, 2)),
1010
fulfilled_by_partner (type BOOLEAN),
1111
terms (type OBJECT),
12+
source_seq (type NUMBER(38, 0), nullable false),
13+
source_loaded_at (type TIMESTAMP_NTZ, nullable false),
1214
),
1315
);
1416

‎benchmarks/duckshop/project/models/staging/storefront/stg_carts.sql‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ MODEL (
1010
updated_at (type TIMESTAMP_TZ),
1111
line_count (type INT),
1212
coupon_code (type VARCHAR),
13+
contents (type OBJECT),
14+
source_seq (type NUMBER(38, 0), nullable false),
15+
source_loaded_at (type TIMESTAMP_NTZ, nullable false),
1316
),
1417
);
1518

‎benchmarks/duckshop/project/models/staging/storefront/stg_customer_addresses.sql‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ MODEL (
1010
latitude (type NUMBER(9, 6)),
1111
longitude (type NUMBER(9, 6)),
1212
geo (type OBJECT),
13+
line1 (type VARCHAR),
14+
line2 (type VARCHAR),
15+
city (type VARCHAR),
16+
source_seq (type NUMBER(38, 0), nullable false),
17+
source_loaded_at (type TIMESTAMP_NTZ, nullable false),
1318
),
1419
);
1520

‎benchmarks/duckshop/project/models/staging/storefront/stg_customers.sql‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ MODEL (
1515
marketing_opt_in (type BOOLEAN),
1616
consent_types (type ARRAY),
1717
birth_year (type INT),
18+
preferences (type OBJECT),
19+
source_seq (type NUMBER(38, 0), nullable false),
20+
source_loaded_at (type TIMESTAMP_NTZ, nullable false),
1821
),
1922
);
2023

0 commit comments

Comments
 (0)