8000 [BugFix] Fix mv refresh bugs when contains null partition values (backport #59939) by mergify[bot] · Pull Request #60031 · StarRocks/starrocks · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[BugFix] Fix mv refresh bugs when contains null partition values (backport #59939) #60031

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

Merged
merged 3 commits into from
Jun 20, 2025

Conversation

mergify[bot]
Copy link
Contributor
@mergify mergify bot commented Jun 18, 2025

Why I'm doing:

SyncPartitionUtils.transferRange cannot handle with some corner values(min/max values):

 2025-06-16 10:53:24.328+08:00 WARN (starrocks-taskrun-pool-1|1049) [PartitionBasedMvRefreshProcessor.doRefreshMaterializedViewWithRetry():402]  [test_mv_case] refresh mv failed at 1th time: com.starrocks.sql.analyzer.SemanticException: Getting analyzing error. Detail message: Convert partition with date_trunc expression to date failed, lower:-0001-12-2
7T00:00, upper:0000-01-09T00:00.
        at com.starrocks.sql.common.SyncPartitionUtils.transferRange(SyncPartitionUtils.java:250)
        at com.starrocks.sql.common.PRangeCellPlus.lambda$toPRangeCellPlus$2(PRangeCellPlus.java:87)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1850)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
        at com.starrocks.sql.common.PRangeCellPlus.toPRangeCellPlus(PRangeCellPlus.java:90)
        at com.starrocks.sql.common.RangePartitionDiffer.generateBaseRefMap(RangePartitionDiffer.java:451)
        at com.starrocks.scheduler.mv.MVPCTRefreshRangePartitioner.syncAddOrDropPartitions(MVPCTRefreshRangePartitioner.java:128)
        at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.syncPartitions(PartitionBasedMvRefreshProcessor.java:985)
        at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.doRefreshMaterializedView(PartitionBasedMvRefreshProcessor.java:437)
        at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.doRefreshMaterializedViewWithRetry(PartitionBasedMvRefreshProcessor.java:393)
        at com.starrocks.scheduler.PartitionBasedMvRefreshProcessor.doMvRefresh(PartitionBasedMvRefreshProcessor.java:354)
        at com.starrocks.sch
8000
eduler.PartitionBasedMvRefreshProcessor.processTaskRun(PartitionBasedMvRefreshProcessor.java:203)
        at com.starrocks.scheduler.TaskRun.executeTaskRun(TaskRun.java:313)
        at com.starrocks.scheduler.TaskRunExecutor.lambda$executeTaskRun$0(TaskRunExecutor.java:60)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)

What I'm doing:

  • Introduced a new utility method transferDateLiteral in SyncPartitionUtils to handle date literal transformations for partition range boundaries, improving code readability and reducing redundancy.
  • Add more test cases.

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.5
    • 3.4
    • 3.3

This is an automatic backport of pull request #59939 done by [Mergify](https://mergify.com).

)

Signed-off-by: shuming.li <ming.moriarty@gmail.com>
(cherry picked from commit 29b3cd1)

# Conflicts:
#	fe/fe-core/src/test/java/com/starrocks/sql/common/SyncPartitionUtilsTest.java
Copy link
Contributor Author
mergify bot commented Jun 18, 2025

Cherry-pick of 29b3cd1 has failed:

On branch mergify/bp/branch-3.3/pr-59939
Your branch is up to date with 'origin/branch-3.3'.

You are currently cherry-picking commit 29b3cd114c.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   fe/fe-core/src/main/java/com/starrocks/sql/common/SyncPartitionUtils.java

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   fe/fe-core/src/test/java/com/starrocks/sql/common/SyncPartitionUtilsTest.java

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot added the conflicts label Jun 18, 2025
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) June 18, 2025 09:17
@mergify mergify bot closed this Jun 18, 2025
auto-merge was automatically disabled June 18, 2025 09:18

Pull request was closed

Copy link
Contributor Author
mergify bot commented Jun 18, 2025

@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr

@LiShuMing LiShuMing reopened this Jun 20, 2025
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) June 20, 2025 06:08
Signed-off-by: shuming.li <ming.moriarty@gmail.com>
LiShuMing
LiShuMing previously approved these changes Jun 20, 2025
Copy link

Signed-off-by: shuming.li <ming.moriarty@gmail.com>
@wanpengfei-git wanpengfei-git merged commit 6c05177 into branch-3.3 Jun 20, 2025
37 of 39 checks passed
@wanpengfei-git wanpengfei-git deleted the mergify/bp/branch-3.3/pr-59939 branch June 20, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0