fix(planner): disable project block merge in non-top-level subplans#34613
fix(planner): disable project block merge in non-top-level subplans#34613guanshengliang merged 1 commit intomainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the query planner's behavior by conditionally disabling the merging of project blocks within subplans. The change ensures that project nodes only merge data blocks when they are the root output of a top-level subplan, preventing incorrect optimizations that could lead to issues like query hangs. A new test case has been added to validate this specific behavior. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Pull request overview
This pull request fixes an issue where project block merging in non-top-level subplans was causing interval query hangs. The fix disables the merge optimization for projection nodes that are not at the root of the top-level subplan.
Changes:
- Modified
projectCanMergeDataBlockfunction to accept atopLevelSubplanparameter and added logic to disallow merging when not at the top level or when the projection has a parent - Updated
createProjectPhysiNodeto pass the subplan object and determine if it's top-level based onsubplan->level == 0 - Added regression test to verify the fix by checking the explain plan output
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| source/libs/planner/src/planPhysiCreater.c | Added top-level subplan check to projectCanMergeDataBlock function and updated createProjectPhysiNode signature to pass subplan |
| test/cases/13-TimeSeriesExt/03-TimeWindow/test_interval_project_merge_resblock.py | Added regression test that verifies Projection Merge ResBlocks is set to False in explain plan |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/cases/13-TimeSeriesExt/03-TimeWindow/test_interval_project_merge_resblock.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Code Review
This pull request disables project block merging for non-top-level subplans to fix a planner issue. The changes in planPhysiCreater.c introduce a topLevelSubplan flag to projectCanMergeDataBlock to control this behavior. The call sites are updated accordingly. A new Python test is added to verify that the Merge ResBlocks flag is correctly set to False in the EXPLAIN plan for a query with a non-terminal projection node. The logic appears sound and the test case effectively validates the fix.
e9eeaba to
00434cf
Compare
00434cf to
efcd78a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
fix(planner): disable project block merge in non-top-level subplans
Issue(s)
Checklist
Please check the items in the checklist if applicable.