Skip to content

TPC-DI A5

TPC-DI benchmark · all TPC-DI queries

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
c.Country,
c.StateProv,
COUNT(DISTINCT c.SK_CustomerID) AS customer_count,
COUNT(t.TradeID) AS trade_count,
SUM(t.Quantity * t.TradePrice) AS total_trade_value,
AVG(c.NetWorth) AS avg_net_worth
FROM DimCustomer AS c
LEFT JOIN FactTrade AS t
ON c.SK_CustomerID = t.SK_CustomerID
WHERE
c.IsCurrent IS TRUE
GROUP BY
c.Country,
c.StateProv
HAVING
customer_count > 10
ORDER BY
total_trade_value DESC
LIMIT 50

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 TPCDI
bench = TPCDI(scale_factor=0.01) # your scale factor
queries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQL
print(queries['A5'])

Source

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