github-actions[bot] commented on code in PR #65024: URL: https://github.com/apache/doris/pull/65024#discussion_r3506950446
########## regression-test/suites/nereids_rules_p0/agg_strategy/bucketed_hash_agg.groovy: ########## @@ -0,0 +1,156 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +suite("bucketed_hash_agg") { + // ============================================================ + // Test: Bucketed Hash Aggregation regression + // + // Verifies that on single-BE deployments with enable_bucketed_hash_agg=true, + // the translator fuses one-phase GLOBAL hash aggregate + distribute into + // a single BUCKETED AGGREGATE operator, eliminating exchange overhead. + // On multi-BE deployments, bucketed agg must NOT be used. + // ============================================================ + + // --- session settings --- + sql "set enable_nereids_planner=true" + sql "set enable_parallel_result_sink=false" + sql "set runtime_filter_mode=OFF" + sql "set parallel_pipeline_task_num=2" + sql "set bucketed_agg_min_input_rows=0" + sql "set bucketed_agg_max_group_keys=0" Review Comment: The positive case now depends on a gate that this setup leaves at its default. This suite disables the min-row and max-group checks, but `bucketed_agg_high_card_threshold` remains `0.3`. For a newly-created, unanalyzed table the GROUP BY column stats are unknown, so `StatsCalculator.estimateGroupByRowCount()` falls back to `rows * DEFAULT_AGGREGATE_RATIO`, and that constant is `1 / 3.0`. `ChildrenPropertiesRegulator.bucketedDataVolumeGatesPass()` then rejects bucketed agg when `outputStats.getRowCount() > rows * threshold`, so `rows / 3 > rows * 0.3` prevents the one-phase aggregate/distribute shape before the translator can emit `BUCKETED AGGREGATE`. Please set `bucketed_agg_high_card_threshold=1.0` (or otherwise make this gate deterministic here) for the positive fusion test, and add a separate negative case if the default high-cardinality gate should be covered. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
