Skip to content

[fix](mtmv) Fix compensate union all wrongly when query rewrite by materialized view #40803#42019

Merged
yiguolei merged 2 commits intoapache:branch-2.1from
seawinde:fix_union_all_compensate_wrong_21
Oct 18, 2024
Merged

[fix](mtmv) Fix compensate union all wrongly when query rewrite by materialized view #40803#42019
yiguolei merged 2 commits intoapache:branch-2.1from
seawinde:fix_union_all_compensate_wrong_21

Conversation

@seawinde
Copy link
Copy Markdown
Member

Proposed changes

pr: #40803
commitId: d7e5d46

seawinde and others added 2 commits October 17, 2024 14:56
…terialized view (apache#40803)

This is brought by apache#36056

Not all query after rewritten successfully can compensate union all
Such as:
mv def sql is as following, partition column is a
```sql
select a, b, count(*) from t1 group by a, b
```
Query is as following:
```sq
select count(*) from t1
```
the result is
+----------+
| count(*) |
+----------+
|       24 |
+----------+

after rewritten by materialized view successfully
If mv part partition is invalid, can not compensate union all, because
result is wrong after
compensate union all.

+----------+
| count(*) |
+----------+
|       24 |
|       3 |
+----------+

This pr fix this.
@doris-robot
Copy link
Copy Markdown

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

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@seawinde
Copy link
Copy Markdown
Member Author

run buildall

@yiguolei yiguolei merged commit 28066a0 into apache:branch-2.1 Oct 18, 2024
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