Skip to content

Add unit tests for TPCH queries #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andygrove opened this issue Jul 3, 2020 · 3 comments
Closed

Add unit tests for TPCH queries #220

andygrove opened this issue Jul 3, 2020 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@andygrove
Copy link
Member

I've started work on making Ballista capable of running the TPCH benchmark and plan on using the latest version of the sqlparser crate.

It would be nice to add the TPCH queries [1] to the unit/integration tests to make sure they can all be parsed correctly. If we need to pick a dialect to test with, I would suggest Hive.

[1] https://github.com/andygrove/tpch-dbgen/tree/master/queries

@andygrove andygrove added help wanted Extra attention is needed good first issue Good for newcomers labels Jul 3, 2020
@Dandandan
Copy link
Contributor

Good idea. Also linked to TPC-DS in this issue
#212

@Dandandan
Copy link
Contributor

Added a PR here #221

FYI, nr 6 and 22 are failing currently:

select
	sum(l_extendedprice * l_discount) as revenue
from
	lineitem
where
	l_shipdate >= date '1994-01-01'
	and l_shipdate < date '1994-01-01' + interval '1' year
	and l_discount between .06 - 0.01 and .06 + 0.01
	and l_quantity < 24;
select
	cntrycode,
	count(*) as numcust,
	sum(c_acctbal) as totacctbal
from
	(
		select
			substring(c_phone from 1 for 2) as cntrycode,
			c_acctbal
		from
			customer
		where
			substring(c_phone from 1 for 2) in
				('13', '31', '23', '29', '30', '18', '17')
			and c_acctbal > (
				select
					avg(c_acctbal)
				from
					customer
				where
					c_acctbal > 0.00
					and substring(c_phone from 1 for 2) in
						('13', '31', '23', '29', '30', '18', '17')
			)
			and not exists (
				select
					*
				from
					orders
				where
					o_custkey = c_custkey
			)
	) as custsale
group by
	cntrycode
order by
	cntrycode;

@Dandandan
Copy link
Contributor

PR #221 is merged, can address the ignored tests (6, 22) later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants