From 244017c4f2f01ffa564818835c26b3883b80ee45 Mon Sep 17 00:00:00 2001 From: stonepage <40830455+st1page@users.noreply.github.com> Date: Fri, 3 Nov 2023 17:55:55 +0800 Subject: [PATCH] feat(test): add `nexmark-q15-two-phase` for flamegraph generation (#13234) Co-authored-by: Noel Kwan <47273164+kwannoel@users.noreply.github.com> --- ci/scripts/sql/nexmark/q15-two-phase.drop.sql | 3 +++ ci/scripts/sql/nexmark/q15-two-phase.sql | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 ci/scripts/sql/nexmark/q15-two-phase.drop.sql create mode 100644 ci/scripts/sql/nexmark/q15-two-phase.sql diff --git a/ci/scripts/sql/nexmark/q15-two-phase.drop.sql b/ci/scripts/sql/nexmark/q15-two-phase.drop.sql new file mode 100644 index 0000000000000..de86863a1c150 --- /dev/null +++ b/ci/scripts/sql/nexmark/q15-two-phase.drop.sql @@ -0,0 +1,3 @@ +-- noinspection SqlNoDataSourceInspectionForFile +-- noinspection SqlResolveForFile +DROP SINK nexmark_q15_two_phase; diff --git a/ci/scripts/sql/nexmark/q15-two-phase.sql b/ci/scripts/sql/nexmark/q15-two-phase.sql new file mode 100644 index 0000000000000..81fd417628ccc --- /dev/null +++ b/ci/scripts/sql/nexmark/q15-two-phase.sql @@ -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');