Skip to content
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

test(nexmark): support explain nexmark q15 and q20 #3660

Merged
merged 2 commits into from
Jul 6, 2022
Merged
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
47 changes: 35 additions & 12 deletions src/frontend/test_runner/tests/testdata/nexmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,8 @@
before:
- create_tables
sql: |
/* SELECT
DATE_FORMAT(dateTime, 'yyyy-MM-dd') as `day`,
SELECT
TO_CHAR(dateTime, 'yyyy-MM-dd') as day,
count(*) AS total_bids,
count(*) filter (where price < 10000) AS rank1_bids,
count(*) filter (where price >= 10000 and price < 1000000) AS rank2_bids,
Expand All @@ -449,9 +449,19 @@
count(distinct auction) filter (where price >= 10000 and price < 1000000) AS rank2_auctions,
count(distinct auction) filter (where price >= 1000000) AS rank3_auctions
FROM bid
GROUP BY DATE_FORMAT(dateTime, 'yyyy-MM-dd'); */
/* parser error */
select 1
GROUP BY to_char(dateTime, 'yyyy-MM-dd');
batch_plan: |
BatchExchange { order: [], dist: Single }
BatchHashAgg { group_keys: [$0], aggs: [count, count filter(($1 < 10000:Int32)), count filter((($1 >= 10000:Int32) AND ($1 < 1000000:Int32))), count filter(($1 >= 1000000:Int32)), count(distinct $2), count(distinct $2) filter(($1 < 10000:Int32)), count(distinct $2) filter((($1 >= 10000:Int32) AND ($1 < 1000000:Int32))), count(distinct $2) filter(($1 >= 1000000:Int32)), count(distinct $3), count(distinct $3) filter(($1 < 10000:Int32)), count(distinct $3) filter((($1 >= 10000:Int32) AND ($1 < 1000000:Int32))), count(distinct $3) filter(($1 >= 1000000:Int32))] }
BatchExchange { order: [], dist: HashShard([0]) }
BatchProject { exprs: [ToChar($3, 'yyyy-MM-dd':Varchar), $2, $1, $0] }
BatchScan { table: bid, columns: [auction, bidder, price, dateTime] }
stream_plan: |
StreamMaterialize { columns: [day, agg#0(hidden), total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [day] }
StreamHashAgg { group_keys: [$0], aggs: [count, count, count filter(($1 < 10000:Int32)), count filter((($1 >= 10000:Int32) AND ($1 < 1000000:Int32))), count filter(($1 >= 1000000:Int32)), count(distinct $2), count(distinct $2) filter(($1 < 10000:Int32)), count(distinct $2) filter((($1 >= 10000:Int32) AND ($1 < 1000000:Int32))), count(distinct $2) filter(($1 >= 1000000:Int32)), count(distinct $3), count(distinct $3) filter(($1 < 10000:Int32)), count(distinct $3) filter((($1 >= 10000:Int32) AND ($1 < 1000000:Int32))), count(distinct $3) filter(($1 >= 1000000:Int32))] }
StreamExchange { dist: HashShard([0]) }
StreamProject { exprs: [ToChar($3, 'yyyy-MM-dd':Varchar), $2, $1, $0, $4] }
StreamTableScan { table: bid, columns: [auction, bidder, price, dateTime, _row_id], pk_indices: [4] }
- id: nexmark_q16
before:
- create_tables
Expand Down Expand Up @@ -497,16 +507,29 @@
before:
- create_tables
sql: |
/*
SELECT
auction, bidder, price, channel, url, B.dateTime,
itemName, description, initialBid, reserve, A.dateTime, expires, seller, category,
auction, bidder, price, channel, url, B.dateTime as dateTimeB,
itemName, description, initialBid, reserve, A.dateTime as dateTimeA, expires, seller, category
FROM
bid AS B INNER JOIN auction AS A on B.auction = A.id
bid B INNER JOIN auction A on B.auction = A.id
WHERE A.category = 10;
*/
/* parser error */
select 1
batch_plan: |
BatchExchange { order: [], dist: Single }
BatchHashJoin { type: Inner, predicate: $0 = $6, output_indices: [0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14] }
BatchExchange { order: [], dist: HashShard([0]) }
BatchScan { table: bid, columns: [auction, bidder, price, channel, url, dateTime] }
BatchExchange { order: [], dist: HashShard([0]) }
BatchFilter { predicate: ($8 = 10:Int32) }
BatchScan { table: auction, columns: [id, itemName, description, initialBid, reserve, dateTime, expires, seller, category] }
stream_plan: |
StreamMaterialize { columns: [auction, bidder, price, channel, url, dateTimeB, itemName, description, initialBid, reserve, dateTimeA, expires, seller, category, _row_id(hidden), _row_id#1(hidden)], pk_columns: [_row_id, _row_id#1] }
StreamExchange { dist: HashShard([14, 15]) }
StreamHashJoin { type: Inner, predicate: $0 = $7, output_indices: [0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 6, 16] }
StreamExchange { dist: HashShard([0]) }
StreamTableScan { table: bid, columns: [auction, bidder, price, channel, url, dateTime, _row_id], pk_indices: [6] }
StreamExchange { dist: HashShard([0]) }
StreamFilter { predicate: ($8 = 10:Int32) }
StreamTableScan { table: auction, columns: [id, itemName, description, initialBid, reserve, dateTime, expires, seller, category, _row_id], pk_indices: [9] }
- id: nexmark_q21
before:
- create_tables
Expand Down