Skip to content

Conversation

@github-actions
Copy link
Contributor

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

Cherry-picked from #57343

…r above scan (#57343)

### What problem does this PR solve?

Related PR: #36056 

Problem Summary:

if mv is defined as following

        CREATE MATERIALIZED VIEW mv_11
        BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL 
        DISTRIBUTED BY RANDOM BUCKETS 2 
        PROPERTIES ('replication_num' = '1')  
        AS
            select o_orderstatus, o_orderdate, o_orderpriority,
            sum(o_totalprice) as sum_total,
            max(o_totalprice) as max_total,
            min(o_totalprice) as min_total,
            count(*) as count_all,
            bitmap_union(to_bitmap(case when o_shippriority > 1 and o_orderkey IN (1, 3) then o_custkey else null end)) as bitmap_union_basic
            from orders
            where o_custkey > 1
            group by
            o_orderstatus, o_orderdate, o_orderpriority;
 
there is filter `where o_custkey > 1` in mv, if query is as following,
should be rewritten successfully but fail, because the filter
`o_custkey > 1` is lost compare and could not compensate the filter, the
pr fixed this.

            select o_orderstatus, o_orderpriority,
            grouping_id(o_orderstatus, o_orderpriority),
            grouping_id(o_orderstatus),
            grouping(o_orderstatus),
            sum(o_totalprice),
            max(o_totalprice),
            min(o_totalprice),
            count(*),
            count(distinct case when o_shippriority > 1 and o_orderkey IN (1, 3) then o_custkey else null end)
            from orders
            where o_custkey > 1
            group by
            ROLLUP (o_orderstatus, o_orderpriority);
@github-actions github-actions bot requested a review from yiguolei as a code owner November 3, 2025 03:47
@Thearas
Copy link
Contributor

Thearas commented Nov 3, 2025

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 Nov 3, 2025
@dataroaring dataroaring reopened this Nov 3, 2025
@Thearas
Copy link
Contributor

Thearas commented Nov 3, 2025

run buildall

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage `` 🎉
Increment coverage report
Complete coverage report

@yiguolei yiguolei merged commit 90df6be into branch-4.0 Nov 5, 2025
25 of 27 checks passed
@github-actions github-actions bot deleted the auto-pick-57343-branch-4.0 branch November 5, 2025 15:37
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.

6 participants