This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.2
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.2 by this push:
     new 7d969aca6cc branch-4.2 [fix](regression) Stabilize COUNT pushdown 
assertions in test_pushdown_explain (#69687)
7d969aca6cc is described below

commit 7d969aca6cccc3486397a9cc8d21d1a9aebd86c5
Author: minghong <[email protected]>
AuthorDate: Wed Oct 28 09:25:47 2026 +0800

    branch-4.2 [fix](regression) Stabilize COUNT pushdown assertions in 
test_pushdown_explain (#69687)
    
    ### What problem does this PR solve?
    
    Issue Number: close #xxx
    
    Related PR: #xxx
    
    Problem Summary:
    test_pushdown_explain asserts that the plan of
    select count(1) - count(lo_shipmode) from test_lineorder contains
    pushAggOp=COUNT. lo_shipmode is NOT NULL, so this expression is always
    0.
    RewriteSimpleAggToConstantRule can replace both counts with the table
    row
    count from SimpleAggCacheMgr and fold the whole expression into a
    constant
    VUNION plan before the scan-level COUNT pushdown happens. The row count
    is
    loaded asynchronously, so whether the rule fires depends on whether the
    cache
    has been warmed by the preceding statements. The assertion can therefore
    pass
    or fail depending on statement timing, and the failure can land on the
    second
    or the third count assertion.
    
    Master's query_p0/explain/test_pushdown_explain.groovy already disables
    this
    rule before the count assertions. This patch aligns the branch-4.1 test
    with
    master so the case keeps testing the COUNT pushdown path instead of the
    metadata constant rewrite. The query result is unchanged; this is a test
    stabilization, not a planner behavior change.
    ### Release note
    
    None
    
    ### Check List (For Author)
    
    - Test <!-- At least one of them must be included. -->
        - [ ] Regression test
        - [ ] Unit Test
        - [ ] Manual test (add detailed scripts or steps below)
        - [ ] No need to test or manual test. Explain why:
    - [ ] This is a refactor/code format and no logic has been changed.
            - [ ] Previous test can cover this change.
            - [ ] No code files have been changed.
            - [ ] Other reason <!-- Add your reason?  -->
    
    - Behavior changed:
        - [ ] No.
        - [ ] Yes. <!-- Explain the behavior change -->
    
    - Does this need documentation?
        - [ ] No.
    - [ ] Yes. <!-- Add document PR link here. eg:
    https://github.com/apache/doris-website/pull/1214 -->
    
    ### Check List (For Reviewer who merge this PR)
    
    - [ ] Confirm the release note
    - [ ] Confirm test cases
    - [ ] Confirm document
    - [ ] Add branch pick label <!-- Add branch pick label that this PR
    should merge into -->
---
 regression-test/suites/nereids_p0/explain/test_pushdown_explain.groovy | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/regression-test/suites/nereids_p0/explain/test_pushdown_explain.groovy 
b/regression-test/suites/nereids_p0/explain/test_pushdown_explain.groovy
index 109c868dc67..b4297369e68 100644
--- a/regression-test/suites/nereids_p0/explain/test_pushdown_explain.groovy
+++ b/regression-test/suites/nereids_p0/explain/test_pushdown_explain.groovy
@@ -44,6 +44,9 @@ suite("test_pushdown_explain") {
         "disable_auto_compaction" = "false"
     ); """
     sql """ insert into test_lineorder values(1,2,"asd"); """
+    // Disable REWRITE_SIMPLE_AGG_TO_CONSTANT to prevent the optimizer from 
folding
+    // count() into a constant using metadata row counts, which would skip 
pushAggOp
+    sql "SET disable_nereids_rules='REWRITE_SIMPLE_AGG_TO_CONSTANT'"
     explain {
         sql("select count(1) from test_lineorder;")
         contains "pushAggOp=COUNT"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to