fix: mergeAlignedInterval pkts error#34473
Conversation
Summary of ChangesHello @Tony2h, 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 resolves a critical error in the query planner related to 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. 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.
Code Review
This pull request effectively addresses a bug in query plan splitting for aligned interval windows, particularly in multi-vgroup scenarios. The core change in planSpliter.c correctly identifies and uses both _wstart and stream-related (_twstart) timestamp placeholders to generate merge keys, ensuring proper data merging. This is a significant improvement over the previous logic. The accompanying test changes, which increase the number of vgroups and update expected results, are well-suited to verify this fix.
|
|
||
| def createStreams(self): | ||
| self.streams = [] | ||
| self.streams: list[StreamItem] = [] |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Pull request overview
This PR updates the interval window splitting logic to correctly handle “pkts” placeholders when merging aligned interval windows, and aligns the stream subquery tests with the new behavior by adjusting database layout and expectations.
Changes:
- In
planSpliter.c,stbSplCreatePartWindowNodeis extended to create and propagate appropriate placeholder functions (_twstart/_tprev_tsand_wstart) as both output columns and merge keys, andstbSplSplitIntervalForBatchis updated to use these merge keys instead of primary-key-based merge keys. - All SubQuery stream test suites (
state,sliding,session,event,count_1,count_2) now createqdbwith 2 vgroups, and their “information_schema.ins_databases” sanity-check streams are updated to expect the increased vgroup count. - A small number of flaky tests with inherently random result expectations are consistently disabled (their
self.streams.append(stream)calls are commented) to improve test stability, andtest_subquery_slidingclarifies the type ofself.streams.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
source/libs/planner/src/planSpliter.c |
Refactors interval/external window splitting to add a shared helper for building merge keys from expressions, extends stbSplCreatePartWindowNode to emit both stream placeholders and _wstart and feed these into merge keys and pTspk, and updates stbSplSplitIntervalForBatch to use the new merge-keys-from-placeholders flow. |
test/cases/18-StreamProcessing/07-SubQuery/test_subquery_state.py |
Uses 2 vgroups for qdb and adjusts stream 47’s expected _wstart result to reflect the higher total vgroup count; disables a few tests with random expectations to avoid flakiness. |
test/cases/18-StreamProcessing/07-SubQuery/test_subquery_sliding.py |
Same qdb vgroup increase and stream 47 expectation update as the state tests; annotates self.streams as list[StreamItem] and disables the same random-result tests. |
test/cases/18-StreamProcessing/07-SubQuery/test_subquery_session.py |
Mirrors the state/sliding changes for session-triggered streams: qdb vgroups bumped to 2, stream 47 expectation updated to 4, and several random-result tests skipped. |
test/cases/18-StreamProcessing/07-SubQuery/test_subquery_event.py |
Applies the same qdb vgroup and stream 47 expectation updates for event-triggered streams, and skips the random-result tests for ids 108 and 119. |
test/cases/18-StreamProcessing/07-SubQuery/test_subquery_count_1.py |
For count_window(1, ...) streams, increases qdb vgroups to 2, updates stream 47 expected vgroup sum from 3 to 4, and skips random-result tests at the end of the stream list. |
test/cases/18-StreamProcessing/07-SubQuery/test_subquery_count_2.py |
For count_window(2, ...) streams, mirrors the qdb vgroup change, stream 47 expectation from 3 to 4, and random-result test skips as in the count_1 suite. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Issue(s)
Checklist
Please check the items in the checklist if applicable.