Repository navigation
refactor(streaming): group by filters in args - #3431
Conversation
📝 WalkthroughWalkthroughSwitches SQL filter construction in queryMeter.toSQL from inline quoted strings to parameterized variables, and updates tests to expect parameter placeholders with corresponding argument lists. No method signatures change; overall query structure remains the same. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
openmeter/streaming/clickhouse/meter_query.go (1)
275-276: Good move to parameterize group-by filters; simplify with builder EqualUsing query.Var binds args safely. You can further simplify and avoid relying on Var’s side-effect by using the builder’s Equal helper, which also binds args:
- return fmt.Sprintf("%s = %s", column, query.Var((value))) + return query.Equal(column, value)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
openmeter/streaming/clickhouse/meter_query.go(1 hunks)openmeter/streaming/clickhouse/meter_query_test.go(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Migration Checks
- GitHub Check: Artifacts / Container image
- GitHub Check: Lint
- GitHub Check: Build
- GitHub Check: Test
- GitHub Check: Code Generators
- GitHub Check: Analyze (go)
🔇 Additional comments (4)
openmeter/streaming/clickhouse/meter_query_test.go (4)
399-401: Tests aligned to parameter bindingExpecting placeholders and args for group filters is correct and improves safety.
420-422: LGTM: multiple values bound as paramsMatching two placeholders and args for OR conditions is correct.
441-443: LGTM: multiple groups and valuesPlaceholders and args ordering looks consistent with query construction.
484-486: LGTM: PREWHERE + parameterized filtersThe PREWHERE restructuring and parameterized WHERE conditions match the builder behavior and settings.
Summary by CodeRabbit
Bug Fixes
Refactor
Tests