-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test): add
nexmark-q15-two-phase
for flamegraph generation (#1…
…3234) Co-authored-by: Noel Kwan <[email protected]>
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- noinspection SqlNoDataSourceInspectionForFile | ||
-- noinspection SqlResolveForFile | ||
DROP SINK nexmark_q15_two_phase; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- noinspection SqlNoDataSourceInspectionForFile | ||
-- noinspection SqlResolveForFile | ||
SET rw_force_split_distinct_agg = true; | ||
SET rw_force_two_phase_agg = true; | ||
CREATE SINK nexmark_q15_two_phase AS | ||
SELECT to_char(date_time, '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, | ||
count(*) filter (where price >= 1000000) AS rank3_bids, | ||
count(distinct bidder) AS total_bidders, | ||
count(distinct bidder) filter (where price < 10000) AS rank1_bidders, | ||
count(distinct bidder) filter (where price >= 10000 and price < 1000000) AS rank2_bidders, | ||
count(distinct bidder) filter (where price >= 1000000) AS rank3_bidders, | ||
count(distinct auction) AS total_auctions, | ||
count(distinct auction) filter (where price < 10000) AS rank1_auctions, | ||
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 to_char(date_time, 'YYYY-MM-DD') | ||
WITH ( connector = 'blackhole', type = 'append-only', force_append_only = 'true'); |