From f1fd63ed1470fb076971df43deb1f85af5027a7a Mon Sep 17 00:00:00 2001 From: Noel Kwan <47273164+kwannoel@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:30:18 +0800 Subject: [PATCH] feat(frontend): support single phase approx percentile in batch (#18083) --- .../aggregate/shuffle_approx_percentile.slt | 33 +++++---- ..._approx_percentile_merge_stateless_agg.slt | 39 ++++++++++ .../tests/testdata/input/agg.yaml | 17 +++++ .../tests/testdata/output/agg.yaml | 71 +++++++++++++++++++ .../optimizer/plan_node/batch_simple_agg.rs | 11 ++- 5 files changed, 157 insertions(+), 14 deletions(-) diff --git a/e2e_test/streaming/aggregate/shuffle_approx_percentile.slt b/e2e_test/streaming/aggregate/shuffle_approx_percentile.slt index efc377f8aed4..3f2c400b91f0 100644 --- a/e2e_test/streaming/aggregate/shuffle_approx_percentile.slt +++ b/e2e_test/streaming/aggregate/shuffle_approx_percentile.slt @@ -58,19 +58,6 @@ select * from m1; ---- -982.5779489474152 -804.4614206837127 0 804.4614206837127 982.5779489474152 -# Test state encode / decode -onlyif can-use-recover -statement ok -recover; - -onlyif can-use-recover -sleep 10s - -query I -select * from m1; ----- --982.5779489474152 -804.4614206837127 0 804.4614206837127 982.5779489474152 - # Test 0 bool { - self.core.can_two_phase_agg() && self.two_phase_agg_enabled() + self.core.can_two_phase_agg() + && self + .core + // Ban two phase approx percentile. + .agg_calls + .iter() + .map(|agg_call| &agg_call.agg_kind) + .all(|agg_kind| !matches!(agg_kind, AggKind::Builtin(PbAggKind::ApproxPercentile))) + && self.two_phase_agg_enabled() } }