Fix wrong parameter and return result logic for LogPatternAggFunction#4868
Conversation
Signed-off-by: Songkan Tang <songkant@amazon.com>
|
@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 |
…opensearch-project#4868) Signed-off-by: Songkan Tang <songkant@amazon.com>
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.