-
Notifications
You must be signed in to change notification settings - Fork 181
Fix wrong parameter and return result logic for LogPatternAggFunction #4868
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
Fix wrong parameter and return result logic for LogPatternAggFunction #4868
Conversation
Signed-off-by: Songkan Tang <[email protected]>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
WalkthroughThis change fixes two bugs in the patterns command: incorrect parameter mapping where Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Parser as AstBuilder
participant Agg as LogPatternAggFunction
participant Buffer as LogParserAccumulator
User->>Parser: patterns cmd with max_sample_count=2
Note over Parser: BEFORE: maps to "max_sample_count"<br/>AFTER: maps to "buffer_limit"
Parser->>Agg: add() with buffer limit check
Agg->>Buffer: Check logSize() for limit
Note over Buffer: BEFORE: check size() (patterns)<br/>AFTER: check logSize() (raw logs)
Buffer-->>Agg: Buffer status
Note over Agg: Accumulate patterns & logs
Agg->>Agg: result() - termination logic
Note over Agg: BEFORE: null if size() == 0<br/>AFTER: null if size() == 0 AND logSize() == 0
Agg-->>User: Return patterns + samples
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
🔇 Additional comments (9)
Comment |
…#4868) Signed-off-by: Songkan Tang <[email protected]> (cherry picked from commit 885230f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…#4868) (#4874) (cherry picked from commit 885230f) Signed-off-by: Songkan Tang <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…opensearch-project#4868) Signed-off-by: Songkan Tang <[email protected]>
Description
Current patterns uses wrong
buffer_limitparameter value passed frommax_sample_count. Also, this PR fixes the logic of returning agg result of logPatternAggFunction.Related Issues
Resolves #4866
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.