Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Dec 3, 2025

Cherry-picked from #58406

…rite result wrong (#58406)

### What problem does this PR solve?

This PR addresses two issues: 
1 it stabilizes the regression tests for `topN_rewrite` and
`limit_rewrite`, and
2 it fixes a bug affecting negative test cases. For example, the
following case should not be rewritten successfully but was incorrectly
rewritten

         CREATE MATERIALIZED VIEW mv
        BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
        DISTRIBUTED BY RANDOM BUCKETS 2
        PROPERTIES ('replication_num' = '1') 
        AS
            select
            o_orderdate,
            ps_partkey,
            l_orderkey
            from
            orders left
            join lineitem on l_orderkey = o_orderkey
            left join partsupp on ps_partkey = l_partkey and l_suppkey = ps_suppkey
            where o_orderdate > '2025-01-02'
            order by o_orderdate, l_orderkey, ps_partkey
            limit 8 offset 1;

the query as following should not rewrite successfully

            select
            o_orderdate,
            ps_partkey,
            l_orderkey
            from
            orders left
            join lineitem on l_orderkey = o_orderkey
            left join partsupp on ps_partkey = l_partkey and l_suppkey = ps_suppkey
            order by o_orderdate, l_orderkey
            limit 4 offset 2;
@github-actions github-actions bot requested a review from yiguolei as a code owner December 3, 2025 07:23
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring closed this Dec 3, 2025
@dataroaring dataroaring reopened this Dec 3, 2025
@hello-stephen
Copy link
Contributor

run buildall

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 24.24% (8/33) 🎉
Increment coverage report
Complete coverage report

@yiguolei yiguolei merged commit 25cde8c into branch-4.0 Dec 3, 2025
25 of 27 checks passed
@github-actions github-actions bot deleted the auto-pick-58406-branch-4.0 branch December 3, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants