-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[Enhancement] Add properties excluded_refresh_tables for MaterializedView #50926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Add properties excluded_refresh_tables for MaterializedView #50926
Conversation
Signed-off-by: crossoverJie <crossoverJie@gmail.com>
|
@LiShuMing Please take a look, thanks. |
|
Thanks for your contributions. Can you figure out what's the exact differences between I doubt we can fix above problem in |
|
Thanks for your reply.
In the current situation, the role of Even with this configuration, if other partitioned tables change( UPDATE `par_tbl1` SET `v2` = 2 WHERE `datekey` = '2024-08-05 01:00:00' AND `k1` = 3;
UPDATE `par_tbl3` SET `item_id` = '3' WHERE `datekey` = '2024-10-01 01:00:00' AND `k1` = 3;Expect: Only refresh the data: select * from `par_tbl1` WHERE `datekey` = '2024-08-05 01:00:00' AND `k1` = 3;The trigger code: starrocks/fe/fe-core/src/main/java/com/starrocks/listener/LoadJobMVListener.java Line 152 in c610121
The The key code: starrocks/fe/fe-core/src/main/java/com/starrocks/scheduler/mv/MVPCTRefreshRangePartitioner.java Lines 195 to 202 in e22a42a
|
fe/fe-core/src/main/java/com/starrocks/common/util/PropertyAnalyzer.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/com/starrocks/catalog/MvRefreshArbiter.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/test/java/com/starrocks/analysis/RefreshMaterializedViewTest.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/test/java/com/starrocks/analysis/RefreshMaterializedViewTest.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/com/starrocks/catalog/MaterializedView.java
Outdated
Show resolved
Hide resolved
Signed-off-by: crossoverJie <crossoverJie@gmail.com>
Signed-off-by: crossoverJie <crossoverJie@gmail.com>
Signed-off-by: crossoverJie <crossoverJie@gmail.com>
Signed-off-by: crossoverJie <crossoverJie@gmail.com>
|
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 46 / 56 (82.14%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
|
@Mergifyio backport branch-3.3 |
✅ Backports have been createdDetails
|
|
Merged, THX for your contribution. |
…View (StarRocks#50926) Signed-off-by: crossoverJie <crossoverJie@gmail.com>
…View (StarRocks#50926) Signed-off-by: crossoverJie <crossoverJie@gmail.com>
…View (StarRocks#50926) Signed-off-by: crossoverJie <crossoverJie@gmail.com> Signed-off-by: zhiminr.ren <1240388654@qq.com>
|
请问这个具体改变了什么?这边测试好像无效 |



Why I'm doing:
Create three tables(2 partiton tables, 1 non-partition table):
Create MaterializedView:
When I have three tables, par_tbl1 and par_tbl2 are partition table, and par_tbl3 is non partition table.
When I update partiton and non-partition table (par_tbl1, par_tbl3), all data in par_tbl1 and par_tbl2 will be refreshed once.
The expected result is to only refresh the modified data in
par_tbl1to the MaterializedView.Use this SQL to view the task execution records.
What I'm doing:
Therefore, I have added a new attribute:
excluded_refresh_base_tablesto the MaterializedView.As a result, even if both the partitioned table and the non-partitioned table are updated simultaneously, only the updated data in the partitioned table will be refreshed.
like this:
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: