Skip to content

Conversation

@seawinde
Copy link
Contributor

What problem does this PR solve?

pr: #55674
commitId: c185cde

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • 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
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@seawinde seawinde requested a review from yiguolei as a code owner November 11, 2025 13:30
@Thearas
Copy link
Contributor

Thearas commented Nov 11, 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?

@seawinde
Copy link
Contributor Author

run buildall

@yiguolei yiguolei force-pushed the fix_mv_rewrite_fail_when_rewritten_plan_output_dff_40 branch from 912f667 to ea1f252 Compare November 13, 2025 02:04
@yiguolei
Copy link
Contributor

run buildall

…by key eliminate both happened (apache#55674)

if mv def is as fllowing:

CREATE MATERIALIZED VIEW mv1
BUILD IMMEDIATE REFRESH AUTO
PROPERTIES (
    "replication_num" = "1"
)
as
select
    a.cust_id,
    a.event_type_id,
    a.bind_attr,
    sum(sum_amount) sum_amount,
    date_format(a.created_date, '%Y%m') month,
    a.created_date
from data_event a
join customer b on(a.cust_id=b.cust_id)
group by a.cust_id, a.event_type_id, a.bind_attr, month, a.created_date;

if query is as fllowing, the query pattern, the query can be optimized
by rule `ELIMINATE_CONST_JOIN_CONDITION` and
`ELIMINATE_GROUP_BY_KEY_BY_UNIFORM` this would cause rewrite fail by mv,
the pr fix this

select
    a.cust_id,
    a.event_type_id,
    a.bind_attr,
    sum(sum_amount) sum_amount,
    date_format(created_date, '%Y%m') month
from data_event a
inner join customer b on (a.cust_id = b.cust_id)
where a.cust_id = 410723002257
    and date_format(a.created_date, '%Y%m') = '202509'
group by a.cust_id, a.event_type_id, a.bind_attr, month;
@yiguolei yiguolei force-pushed the fix_mv_rewrite_fail_when_rewritten_plan_output_dff_40 branch from ea1f252 to daf8c0b Compare November 13, 2025 09:21
@yiguolei
Copy link
Contributor

run buildall

@yiguolei yiguolei merged commit 6ffa518 into apache:branch-4.0 Nov 13, 2025
23 of 24 checks passed
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.

3 participants