Skip to content

TPC-DS OBT column lineage

This page is generated from benchbox/core/tpcds_obt/model.yaml, the declarative model that drives the ETL, the CREATE TABLE statement and this page. Regenerate it with uv run -- python -m benchbox.core.tpcds_obt.lineage > docs/benchmarks/tpc-ds-obt-lineage.md.

tpcds_sales_returns_obt has 715 columns at dimension_mode=full. Each channel contributes the rows of its sales table, left-joined to the matching row of its returns table on the order or ticket number and the item.

Channels

ChannelSales tableReturns tableReturns join
storestore_salesstore_returnsss.ss_ticket_number = sr.sr_ticket_number AND ss.ss_item_sk = sr.sr_item_sk
webweb_salesweb_returnsws.ws_order_number = wr.wr_order_number AND ws.ws_item_sk = wr.wr_item_sk
catalogcatalog_salescatalog_returnscs.cs_order_number = cr.cr_order_number AND cs.cs_item_sk = cr.cr_item_sk

Fact columns

A channel with no source writes NULL.

ColumnTypeStoreWebCatalog
channelVARCHAR(10)'store''web''catalog'
sale_idINTEGERss.ss_ticket_numberws.ws_order_numbercs.cs_order_number
item_skINTEGERss.ss_item_skws.ws_item_skcs.cs_item_sk
sold_date_skINTEGERss.ss_sold_date_skws.ws_sold_date_skcs.cs_sold_date_sk
sold_time_skINTEGERss.ss_sold_time_skws.ws_sold_time_skcs.cs_sold_time_sk
ship_date_skINTEGERNULLws.ws_ship_date_skcs.cs_ship_date_sk
returned_date_skINTEGERsr.sr_returned_date_skwr.wr_returned_date_skcr.cr_returned_date_sk
returned_time_skINTEGERsr.sr_return_time_skwr.wr_returned_time_skcr.cr_returned_time_sk
bill_customer_skINTEGERss.ss_customer_skws.ws_bill_customer_skcs.cs_bill_customer_sk
bill_cdemo_skINTEGERss.ss_cdemo_skws.ws_bill_cdemo_skcs.cs_bill_cdemo_sk
bill_hdemo_skINTEGERss.ss_hdemo_skws.ws_bill_hdemo_skcs.cs_bill_hdemo_sk
bill_addr_skINTEGERss.ss_addr_skws.ws_bill_addr_skcs.cs_bill_addr_sk
ship_customer_skINTEGERss.ss_customer_skws.ws_ship_customer_skcs.cs_ship_customer_sk
ship_cdemo_skINTEGERss.ss_cdemo_skws.ws_ship_cdemo_skcs.cs_ship_cdemo_sk
ship_hdemo_skINTEGERss.ss_hdemo_skws.ws_ship_hdemo_skcs.cs_ship_hdemo_sk
ship_addr_skINTEGERss.ss_addr_skws.ws_ship_addr_skcs.cs_ship_addr_sk
store_skINTEGERss.ss_store_skNULLNULL
web_site_skINTEGERNULLws.ws_web_site_skNULL
web_page_skINTEGERNULLws.ws_web_page_skNULL
call_center_skINTEGERNULLNULLcs.cs_call_center_sk
catalog_page_skINTEGERNULLNULLcs.cs_catalog_page_sk
ship_mode_skINTEGERNULLws.ws_ship_mode_skcs.cs_ship_mode_sk
warehouse_skINTEGERNULLws.ws_warehouse_skcs.cs_warehouse_sk
promo_skINTEGERss.ss_promo_skws.ws_promo_skcs.cs_promo_sk
reason_skINTEGERsr.sr_reason_skwr.wr_reason_skcr.cr_reason_sk
quantityINTEGERss.ss_quantityws.ws_quantitycs.cs_quantity
wholesale_costDECIMAL(15,2)ss.ss_wholesale_costws.ws_wholesale_costcs.cs_wholesale_cost
list_priceDECIMAL(15,2)ss.ss_list_pricews.ws_list_pricecs.cs_list_price
sales_priceDECIMAL(15,2)ss.ss_sales_pricews.ws_sales_pricecs.cs_sales_price
ext_discount_amtDECIMAL(15,2)ss.ss_ext_discount_amtws.ws_ext_discount_amtcs.cs_ext_discount_amt
ext_sales_priceDECIMAL(15,2)ss.ss_ext_sales_pricews.ws_ext_sales_pricecs.cs_ext_sales_price
ext_wholesale_costDECIMAL(15,2)ss.ss_ext_wholesale_costws.ws_ext_wholesale_costcs.cs_ext_wholesale_cost
ext_list_priceDECIMAL(15,2)ss.ss_ext_list_pricews.ws_ext_list_pricecs.cs_ext_list_price
ext_taxDECIMAL(15,2)ss.ss_ext_taxws.ws_ext_taxcs.cs_ext_tax
coupon_amtDECIMAL(15,2)ss.ss_coupon_amtws.ws_coupon_amtcs.cs_coupon_amt
ext_ship_costDECIMAL(15,2)NULLws.ws_ext_ship_costcs.cs_ext_ship_cost
net_paidDECIMAL(15,2)ss.ss_net_paidws.ws_net_paidcs.cs_net_paid
net_paid_inc_taxDECIMAL(15,2)ss.ss_net_paid_inc_taxws.ws_net_paid_inc_taxcs.cs_net_paid_inc_tax
net_paid_inc_shipDECIMAL(15,2)NULLws.ws_net_paid_inc_shipcs.cs_net_paid_inc_ship
net_paid_inc_ship_taxDECIMAL(15,2)NULLws.ws_net_paid_inc_ship_taxcs.cs_net_paid_inc_ship_tax
net_profitDECIMAL(15,2)ss.ss_net_profitws.ws_net_profitcs.cs_net_profit
return_quantityINTEGERsr.sr_return_quantitywr.wr_return_quantitycr.cr_return_quantity
return_amountDECIMAL(15,2)sr.sr_return_amtwr.wr_return_amtcr.cr_return_amount
return_taxDECIMAL(15,2)sr.sr_return_taxwr.wr_return_taxcr.cr_return_tax
return_amount_inc_taxDECIMAL(15,2)sr.sr_return_amt_inc_taxwr.wr_return_amt_inc_taxcr.cr_return_amt_inc_tax
return_feeDECIMAL(15,2)sr.sr_feewr.wr_feecr.cr_fee
return_ship_costDECIMAL(15,2)sr.sr_return_ship_costwr.wr_return_ship_costcr.cr_return_ship_cost
refunded_cashDECIMAL(15,2)sr.sr_refunded_cashwr.wr_refunded_cashcr.cr_refunded_cash
reversed_chargeDECIMAL(15,2)sr.sr_reversed_chargewr.wr_reversed_chargecr.cr_reversed_charge
account_creditDECIMAL(15,2)NULLwr.wr_account_creditNULL
store_creditDECIMAL(15,2)sr.sr_store_creditNULLcr.cr_store_credit
return_net_lossDECIMAL(15,2)sr.sr_net_losswr.wr_net_losscr.cr_net_loss
has_returnCHAR(1)CASE WHEN sr.sr_ticket_number IS NULL THEN 'N' ELSE 'Y' ENDCASE WHEN wr.wr_order_number IS NULL THEN 'N' ELSE 'Y' ENDCASE WHEN cr.cr_order_number IS NULL THEN 'N' ELSE 'Y' END

Dimension roles

Each role adds every column of its source table under the role prefix. Roles marked with an income band also add <prefix>ib_lower_bound and <prefix>ib_upper_bound from income_band. A role that joins through another role reads its key from that role’s columns, so it needs no key on the fact row.

RolePrefixSource tableJoin keyColumns
sold_datesold_date_date_dimstore: ss.ss_sold_date_sk
web: ws.ws_sold_date_sk
catalog: cs.cs_sold_date_sk
28
sold_timesold_time_time_dimstore: ss.ss_sold_time_sk
web: ws.ws_sold_time_sk
catalog: cs.cs_sold_time_sk
10
ship_dateship_date_date_dimweb: ws.ws_ship_date_sk
catalog: cs.cs_ship_date_sk
28
return_datereturn_date_date_dimstore: sr.sr_returned_date_sk
web: wr.wr_returned_date_sk
catalog: cr.cr_returned_date_sk
28
return_timereturn_time_time_dimstore: sr.sr_return_time_sk
web: wr.wr_returned_time_sk
catalog: cr.cr_returned_time_sk
10
itemitem_itemstore: ss.ss_item_sk
web: ws.ws_item_sk
catalog: cs.cs_item_sk
22
promotionpromo_promotionstore: ss.ss_promo_sk
web: ws.ws_promo_sk
catalog: cs.cs_promo_sk
19
reasonreason_reasonstore: sr.sr_reason_sk
web: wr.wr_reason_sk
catalog: cr.cr_reason_sk
3
storestore_storestore: ss.ss_store_sk29
web_siteweb_site_web_siteweb: ws.ws_web_site_sk26
web_pageweb_page_web_pageweb: ws.ws_web_page_sk14
call_centercall_center_call_centercatalog: cs.cs_call_center_sk31
catalog_pagecatalog_page_catalog_pagecatalog: cs.cs_catalog_page_sk9
ship_modeship_mode_ship_modeweb: ws.ws_ship_mode_sk
catalog: cs.cs_ship_mode_sk
6
warehousewarehouse_warehouseweb: ws.ws_warehouse_sk
catalog: cs.cs_warehouse_sk
14
bill_customerbill_customer_customerstore: ss.ss_customer_sk
web: ws.ws_bill_customer_sk
catalog: cs.cs_bill_customer_sk
18
ship_customership_customer_customerstore: ss.ss_customer_sk
web: ws.ws_ship_customer_sk
catalog: cs.cs_ship_customer_sk
18
returning_customerreturning_customer_customerstore: sr.sr_customer_sk
web: wr.wr_returning_customer_sk
catalog: cr.cr_returning_customer_sk
18
refunded_customerrefunded_customer_customerstore: sr.sr_customer_sk
web: wr.wr_refunded_customer_sk
catalog: cr.cr_refunded_customer_sk
18
bill_cdemobill_cdemo_customer_demographicsstore: ss.ss_cdemo_sk
web: ws.ws_bill_cdemo_sk
catalog: cs.cs_bill_cdemo_sk
9
ship_cdemoship_cdemo_customer_demographicsstore: ss.ss_cdemo_sk
web: ws.ws_ship_cdemo_sk
catalog: cs.cs_ship_cdemo_sk
9
returning_cdemoreturning_cdemo_customer_demographicsstore: sr.sr_cdemo_sk
web: wr.wr_returning_cdemo_sk
catalog: cr.cr_returning_cdemo_sk
9
refunded_cdemorefunded_cdemo_customer_demographicsstore: sr.sr_cdemo_sk
web: wr.wr_refunded_cdemo_sk
catalog: cr.cr_refunded_cdemo_sk
9
bill_hdemobill_hdemo_household_demographicsstore: ss.ss_hdemo_sk
web: ws.ws_bill_hdemo_sk
catalog: cs.cs_bill_hdemo_sk
7
ship_hdemoship_hdemo_household_demographicsstore: ss.ss_hdemo_sk
web: ws.ws_ship_hdemo_sk
catalog: cs.cs_ship_hdemo_sk
7
returning_hdemoreturning_hdemo_household_demographicsstore: sr.sr_hdemo_sk
web: wr.wr_returning_hdemo_sk
catalog: cr.cr_returning_hdemo_sk
7
refunded_hdemorefunded_hdemo_household_demographicsstore: sr.sr_hdemo_sk
web: wr.wr_refunded_hdemo_sk
catalog: cr.cr_refunded_hdemo_sk
7
bill_addressbill_addr_customer_addressstore: ss.ss_addr_sk
web: ws.ws_bill_addr_sk
catalog: cs.cs_bill_addr_sk
13
ship_addressship_addr_customer_addressstore: ss.ss_addr_sk
web: ws.ws_ship_addr_sk
catalog: cs.cs_ship_addr_sk
13
returning_addressreturning_addr_customer_addressstore: sr.sr_addr_sk
web: wr.wr_returning_addr_sk
catalog: cr.cr_returning_addr_sk
13
refunded_addressrefunded_addr_customer_addressstore: sr.sr_addr_sk
web: wr.wr_refunded_addr_sk
catalog: cr.cr_refunded_addr_sk
13
bill_cur_addrbill_cur_addr_customer_addressbill_customer.c_current_addr_sk13
bill_cur_cdemobill_cur_cdemo_customer_demographicsbill_customer.c_current_cdemo_sk9
bill_cur_hdemobill_cur_hdemo_household_demographicsbill_customer.c_current_hdemo_sk7
bill_first_sales_datebill_first_sales_date_date_dimbill_customer.c_first_sales_date_sk28
bill_first_shipto_datebill_first_shipto_date_date_dimbill_customer.c_first_shipto_date_sk28
returning_cur_addrreturning_cur_addr_customer_addressreturning_customer.c_current_addr_sk13
returning_cur_cdemoreturning_cur_cdemo_customer_demographicsreturning_customer.c_current_cdemo_sk9
returning_cur_hdemoreturning_cur_hdemo_household_demographicsreturning_customer.c_current_hdemo_sk7
return_storereturn_store_storestore: sr.sr_store_sk29
return_call_centerreturn_call_center_call_centercatalog: cr.cr_call_center_sk31
return_catalog_pagereturn_catalog_page_catalog_pagecatalog: cr.cr_catalog_page_sk9
return_web_pagereturn_web_page_web_pageweb: wr.wr_web_page_sk14

Coverage

The ETL fails when a full-width build at scale factor 1 or above breaks the coverage the queries rely on: every calendar day from 1998-01-01 to 2002-12-31 has a sale and every item appears in at least one row.