Skip to content

TPC-DS-OBT Q45

TPC-DS-OBT benchmark · all TPC-DS-OBT queries

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
bill_addr_ca_zip,
bill_addr_ca_city,
SUM(sales_price)
FROM tpcds_sales_returns_obt AS obt
WHERE
(
bill_customer_sk = bill_customer_c_customer_sk
AND bill_customer_c_current_addr_sk = bill_addr_ca_address_sk
AND item_sk = item_i_item_sk
AND (
SUBSTRING(bill_addr_ca_zip FROM 1 FOR 5) IN ('85669', '86197', '88274', '83405', '86475', '85392', '85460', '80348', '81792')
OR item_i_item_id IN (
SELECT
obt.item_i_item_id
FROM tpcds_sales_returns_obt AS obt
WHERE
obt.item_i_item_sk IN (2, 3, 5, 7, 11, 13, 17, 19, 23, 29) AND channel = 'web'
)
)
AND sold_date_sk = sold_date_d_date_sk
AND sold_date_d_qoy = 1
AND sold_date_d_year = 1998
)
AND channel = 'web'
GROUP BY
bill_addr_ca_zip,
bill_addr_ca_city
ORDER BY
bill_addr_ca_zip,
bill_addr_ca_city
LIMIT 100

Representative DataFrame

No DataFrame implementation is registered for this query.

Get the exact query for your run

The blocks above are representative. To get the precise statement a specific platform runs at a specific scale, substitute your own values:

from benchbox import TPCDSOBT
bench = TPCDSOBT(scale_factor=1.0) # your scale factor
queries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQL
print(queries['45'])

Source

Query text: benchbox/core/tpcds_obt/queries.py