Skip to content

[fix](mtmv) Fix data wrong when query with table operator such as TABLESAMPLE or tablet and so on - #43030

Merged
morrySnow merged 6 commits into
apache:masterfrom
seawinde:add_query_with_tablet_etc_test
Dec 2, 2024
Merged

[fix](mtmv) Fix data wrong when query with table operator such as TABLESAMPLE or tablet and so on#43030
morrySnow merged 6 commits into
apache:masterfrom
seawinde:add_query_with_tablet_etc_test

Conversation

@seawinde

Copy link
Copy Markdown
Member

What problem does this PR solve?

Materialized view is as following:

 CREATE MATERIALIZED VIEW mv1
BUILD IMMEDIATE REFRESH AUTO ON MANUAL DISTRIBUTED BY RANDOM BUCKETS 2 PROPERTIES ('replication_num'='1') ASselect*from orders

If run query as following, should rewrite fail by materialized view above to make sure data correctness

select*from orders TABLET(110);
select*from orders index query_index_test;
select*from orders TABLESAMPLE(20 percent);
select*from orders_partition PARTITION (day_2);

At before, this would rewrite by materialized view succesfully and the result data is wrong, This pr fix this.

Issue Number: close #xxx

Related PR: #28064

Problem Summary:

Check List (For Committer)

  • 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 colde files have been changed.
      • Other reason
  • Behavior changed:

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

    • No.
    • Yes.
  • Release note

    None

Check List (For Reviewer who merge this PR)

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

@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
MemberAuthor

run buildall

@seawindeseawinde changed the title [fix](mtmv) Fix data wrong when query with table operator such as TABLESAMPLE or tablet and so ono[fix](mtmv) Fix data wrong when query with table operator such as TABLESAMPLE or tablet and so onOct 31, 2024
@seawinde

Copy link
Copy Markdown
MemberAuthor

run buildall

@seawinde
seawindeforce-pushed the add_query_with_tablet_etc_test branch from eda8d89 to 1767731CompareNovember 4, 2024 09:47
@seawinde

Copy link
Copy Markdown
MemberAuthor

run buildall

1 similar comment
@seawinde

Copy link
Copy Markdown
MemberAuthor

run buildall

morrySnow
morrySnow previously approved these changes Nov 7, 2024
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actionsgithub-actionsBot added approved Indicates a PR has been approved by one committer. reviewed labels Nov 7, 2024
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@zfr9527zfr9527 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@morrySnow

Copy link
Copy Markdown
Contributor

run cloud_p0

@seawinde
seawindeforce-pushed the add_query_with_tablet_etc_test branch from 12107f2 to db7ec16CompareNovember 7, 2024 09:35
@seawinde

Copy link
Copy Markdown
MemberAuthor

run buildall

@morrySnow
morrySnowforce-pushed the add_query_with_tablet_etc_test branch from db7ec16 to 50b5c49CompareNovember 19, 2024 13:07
@morrySnow

Copy link
Copy Markdown
Contributor

run buildall

@morrySnow

Copy link
Copy Markdown
Contributor

run p0

@morrySnow
morrySnowforce-pushed the add_query_with_tablet_etc_test branch from 50b5c49 to 3d3311dCompareNovember 22, 2024 09:00
@morrySnow

Copy link
Copy Markdown
Contributor

run buildall

@seawinde
seawindeforce-pushed the add_query_with_tablet_etc_test branch 2 times, most recently from 5e8002c to 27daea3CompareNovember 28, 2024 02:21
@seawinde

Copy link
Copy Markdown
MemberAuthor

run buildall

@seawinde
seawindeforce-pushed the add_query_with_tablet_etc_test branch from 27daea3 to 793bbe7CompareNovember 28, 2024 06:35
@seawinde

Copy link
Copy Markdown
MemberAuthor

run buildall

@morrySnow
morrySnow merged commit 6f87e35 into apache:masterDec 2, 2024
github-actionsBot pushed a commit that referenced this pull request Dec 2, 2024
…LESAMPLE or tablet and so on (#43030)
Related PR: #28064
Materialized view is as following:
CREATE MATERIALIZED VIEW mv1
BUILD IMMEDIATE REFRESH AUTO ON MANUAL DISTRIBUTED BY RANDOM BUCKETS 2 PROPERTIES ('replication_num' = '1') AS select * from orders
If run query as following, should rewrite fail by materialized view
above to make sure data correctness
select * from orders TABLET(110);
select * from orders index query_index_test;
select * from orders TABLESAMPLE(20 percent);
select * from orders_partition PARTITION (day_2);
At before, this would rewrite by materialized view succesfully and the
result data is wrong, This pr fix this.
morrySnow pushed a commit that referenced this pull request Dec 6, 2024
… such as TABLESAMPLE or tablet and so on #43030 (#44873)
Cherry-picked from #43030
Co-authored-by: seawinde <wusi@selectdb.com>
seawinde added a commit to seawinde/doris that referenced this pull request Dec 6, 2024
…LESAMPLE or tablet and so on (apache#43030)
Related PR: apache#28064
Materialized view is as following:
CREATE MATERIALIZED VIEW mv1
BUILD IMMEDIATE REFRESH AUTO ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1')
AS
select * from orders
If run query as following, should rewrite fail by materialized view
above to make sure data correctness
select * from orders TABLET(110);
select * from orders index query_index_test;
select * from orders TABLESAMPLE(20 percent);
select * from orders_partition PARTITION (day_2);
At before, this would rewrite by materialized view succesfully and the
result data is wrong, This pr fix this.
HappenLee pushed a commit to HappenLee/incubator-doris that referenced this pull request Apr 24, 2026
…LESAMPLE or tablet and so on (apache#43030)
Related PR: apache#28064
Materialized view is as following:
CREATE MATERIALIZED VIEW mv1
BUILD IMMEDIATE REFRESH AUTO ON MANUAL DISTRIBUTED BY RANDOM BUCKETS 2 PROPERTIES ('replication_num' = '1') AS select * from orders
If run query as following, should rewrite fail by materialized view
above to make sure data correctness
select * from orders TABLET(110);
select * from orders index query_index_test;
select * from orders TABLESAMPLE(20 percent);
select * from orders_partition PARTITION (day_2);
At before, this would rewrite by materialized view succesfully and the
result data is wrong, This pr fix this.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.dev/2.1.8-mergeddev/3.0.4-mergedreviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@seawinde@doris-robot@morrySnow@zfr9527@yiguolei