Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions vortex-sqllogictest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ working directory accordingly.
TPC-H scripts live under `slt/tpch/datafusion/` and `slt/tpch/duckdb/`, TPC-DS scripts under
`slt/tpcds/datafusion/` and `slt/tpcds/duckdb/`, ClickBench scripts under
`slt/clickbench/datafusion/` and `slt/clickbench/duckdb/`. Each engine has its own
`create.slt.no`, `results/q*.slt.no` (`q1` to `q22` for TPC-H, `q0` to `q42` for ClickBench,
matching the upstream numbering), and `drop.slt.no`. Its `tpch.slt`/`clickbench.slt` runs these
against Vortex and asserts EXPLAIN output from the matching `plans/q*.slt.no`. Its `parquet.slt`
runs the same queries against the original Parquet fixtures and checks the same expected results.
TPC-DS asserts plans only for now: `tpcds.slt` runs `plans/q1.slt.no` to `plans/q99.slt.no`
against Vortex, without result records or a Parquet comparison.
`create.slt.no`, `results/q*.slt.no` (`q1` to `q22` for TPC-H, `q1` to `q99` for TPC-DS, `q0` to
`q42` for ClickBench, matching the upstream numbering), and `drop.slt.no`. Its
`tpch.slt`/`tpcds.slt`/`clickbench.slt` runs these against Vortex and asserts EXPLAIN output from
the matching `plans/q*.slt.no`. Its `parquet.slt` runs the same queries against the original
Parquet fixtures and checks the same expected results.
DataFusion uses external tables; DuckDB uses views over files. The `FILE_FORMAT` substitution
variable selects the format in each engine's table setup.

Expand Down
11 changes: 11 additions & 0 deletions vortex-sqllogictest/slt/tpcds/datafusion/parquet.slt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright the Vortex contributors

include ../../setup.slt.no

let FILE_FORMAT
SELECT 'parquet';

include ./create.slt.no
include ./results/*.slt.no
include ./drop.slt.no
128 changes: 128 additions & 0 deletions vortex-sqllogictest/slt/tpcds/datafusion/results/q1.slt.no
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright the Vortex contributors

query T
WITH customer_total_return AS
(SELECT sr_customer_sk AS ctr_customer_sk,
sr_store_sk AS ctr_store_sk,
sum(sr_return_amt) AS ctr_total_return
FROM store_returns,
date_dim
WHERE sr_returned_date_sk = d_date_sk
AND d_year = 2000
GROUP BY sr_customer_sk,
sr_store_sk)
SELECT c_customer_id
FROM customer_total_return ctr1,
store,
customer
WHERE ctr1.ctr_total_return >
(SELECT avg(ctr_total_return)*1.2
FROM customer_total_return ctr2
WHERE ctr1.ctr_store_sk = ctr2.ctr_store_sk)
AND s_store_sk = ctr1.ctr_store_sk
AND s_state = 'TN'
AND ctr1.ctr_customer_sk = c_customer_sk
ORDER BY c_customer_id
LIMIT 100;
----
AAAAAAAAAAFBAAAA
AAAAAAAAAANAAAAA
AAAAAAAAABDBAAAA
AAAAAAAAABEBAAAA
AAAAAAAAABECAAAA
AAAAAAAAABHBAAAA
AAAAAAAAABKBAAAA
AAAAAAAAABMAAAAA
AAAAAAAAACFCAAAA
AAAAAAAAACJBAAAA
AAAAAAAAADBBAAAA
AAAAAAAAADCCAAAA
AAAAAAAAADJAAAAA
AAAAAAAAADNAAAAA
AAAAAAAAAEEBAAAA
AAAAAAAAAEGCAAAA
AAAAAAAAAEJBAAAA
AAAAAAAAAEKAAAAA
AAAAAAAAAEPAAAAA
AAAAAAAAAFDCAAAA
AAAAAAAAAFKBAAAA
AAAAAAAAAGFBAAAA
AAAAAAAAAGPBAAAA
AAAAAAAAAHFBAAAA
AAAAAAAAAHHAAAAA
AAAAAAAAAHJAAAAA
AAAAAAAAAHMAAAAA
AAAAAAAAAHPBAAAA
AAAAAAAAAIKBAAAA
AAAAAAAAAILBAAAA
AAAAAAAAAJJAAAAA
AAAAAAAAAJMAAAAA
AAAAAAAAAKCAAAAA
AAAA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AAA
AAAAAAAABMCBAAAA
AAAAAAAABMDBAAAA
AAAAAAAABMEBAAAA
71 changes: 71 additions & 0 deletions vortex-sqllogictest/slt/tpcds/datafusion/results/q10.slt.no
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright the Vortex contributors

query TTTIIITIIIIIII
SELECT cd_gender,
cd_marital_status,
cd_education_status,
count(*) cnt1,
cd_purchase_estimate,
count(*) cnt2,
cd_credit_rating,
count(*) cnt3,
cd_dep_count,
count(*) cnt4,
cd_dep_employed_count,
count(*) cnt5,
cd_dep_college_count,
count(*) cnt6
FROM customer c,
customer_address ca,
customer_demographics
WHERE c.c_current_addr_sk = ca.ca_address_sk
AND ca_county IN ('Rush County',
'Toole County',
'Jefferson County',
'Dona Ana County',
'La Porte County')
AND cd_demo_sk = c.c_current_cdemo_sk
AND EXISTS
(SELECT *
FROM store_sales,
date_dim
WHERE c.c_customer_sk = ss_customer_sk
AND ss_sold_date_sk = d_date_sk
AND d_year = 2002
AND d_moy BETWEEN 1 AND 1+3)
AND (EXISTS
(SELECT *
FROM web_sales,
date_dim
WHERE c.c_customer_sk = ws_bill_customer_sk
AND ws_sold_date_sk = d_date_sk
AND d_year = 2002
AND d_moy BETWEEN 1 AND 1+3)
OR EXISTS
(SELECT *
FROM catalog_sales,
date_dim
WHERE c.c_customer_sk = cs_ship_customer_sk
AND cs_sold_date_sk = d_date_sk
AND d_year = 2002
AND d_moy BETWEEN 1 AND 1+3))
GROUP BY cd_gender,
cd_marital_status,
cd_education_status,
cd_purchase_estimate,
cd_credit_rating,
cd_dep_count,
cd_dep_employed_count,
cd_dep_college_count
ORDER BY cd_gender,
cd_marital_status,
cd_education_status,
cd_purchase_estimate,
cd_credit_rating,
cd_dep_count,
cd_dep_employed_count,
cd_dep_college_count
LIMIT 100;
----
M D College 1 9500 1 Good 1 5 1 1 1 0 1
89 changes: 89 additions & 0 deletions vortex-sqllogictest/slt/tpcds/datafusion/results/q11.slt.no
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright the Vortex contributors

query TTTT
WITH year_total AS
(SELECT c_customer_id customer_id,
c_first_name customer_first_name,
c_last_name customer_last_name,
c_preferred_cust_flag customer_preferred_cust_flag,
c_birth_country customer_birth_country,
c_login customer_login,
c_email_address customer_email_address,
d_year dyear,
sum(ss_ext_list_price-ss_ext_discount_amt) year_total,
's' sale_type
FROM customer,
store_sales,
date_dim
WHERE c_customer_sk = ss_customer_sk
AND ss_sold_date_sk = d_date_sk
GROUP BY c_customer_id,
c_first_name,
c_last_name,
c_preferred_cust_flag,
c_birth_country,
c_login,
c_email_address,
d_year
UNION ALL SELECT c_customer_id customer_id,
c_first_name customer_first_name,
c_last_name customer_last_name,
c_preferred_cust_flag customer_preferred_cust_flag,
c_birth_country customer_birth_country,
c_login customer_login,
c_email_address customer_email_address,
d_year dyear,
sum(ws_ext_list_price-ws_ext_discount_amt) year_total,
'w' sale_type
FROM customer,
web_sales,
date_dim
WHERE c_customer_sk = ws_bill_customer_sk
AND ws_sold_date_sk = d_date_sk
GROUP BY c_customer_id,
c_first_name,
c_last_name,
c_preferred_cust_flag,
c_birth_country,
c_login,
c_email_address,
d_year)
SELECT t_s_secyear.customer_id,
t_s_secyear.customer_first_name,
t_s_secyear.customer_last_name,
t_s_secyear.customer_preferred_cust_flag
FROM year_total t_s_firstyear,
year_total t_s_secyear,
year_total t_w_firstyear,
year_total t_w_secyear
WHERE t_s_secyear.customer_id = t_s_firstyear.customer_id
AND t_s_firstyear.customer_id = t_w_secyear.customer_id
AND t_s_firstyear.customer_id = t_w_firstyear.customer_id
AND t_s_firstyear.sale_type = 's'
AND t_w_firstyear.sale_type = 'w'
AND t_s_secyear.sale_type = 's'
AND t_w_secyear.sale_type = 'w'
AND t_s_firstyear.dyear = 2001
AND t_s_secyear.dyear = 2001+1
AND t_w_firstyear.dyear = 2001
AND t_w_secyear.dyear = 2001+1
AND t_s_firstyear.year_total > 0
AND t_w_firstyear.year_total > 0
AND CASE
WHEN t_w_firstyear.year_total > 0 THEN (t_w_secyear.year_total*1.0000) / t_w_firstyear.year_total
ELSE 0.0
END > CASE
WHEN t_s_firstyear.year_total > 0 THEN (t_s_secyear.year_total*1.0000) / t_s_firstyear.year_total
ELSE 0.0
END
ORDER BY t_s_secyear.customer_id NULLS FIRST,
t_s_secyear.customer_first_name NULLS FIRST,
t_s_secyear.customer_last_name NULLS FIRST,
t_s_secyear.customer_preferred_cust_flag NULLS FIRST
LIMIT 100;
----
AAAAAAAAFNMBAAAA Shawnna Freeland Y
AAAAAAAAKJHBAAAA Roderick Ballard Y
AAAAAAAALFNAAAAA David Gonzalez N
AAAAAAAALKIAAAAA John Robbins Y
Loading
Loading