RockteMQ-AI commented on issue #299: URL: https://github.com/apache/rocketmq-streams/issues/299#issuecomment-5537644473
**Issue Evaluation** Category: `bug` | Status: **Confirmed** This is a real bug. Analysis of `GroupedStreamImpl.java`: - **Line 64 and Line 80**: Both `count()` methods have **identical implementations** — both use `(key, value, agg) -> agg + 1` - **The `selectAction` parameter is completely ignored** — no null-check, no usage - **Inconsistent with API convention**: Sibling methods like `sum(SelectAction)`, `min()`, `max()` all properly use their selector parameters. Only `count()` drops it. - **Silently wrong behavior**: Example code calls `.keyBy(User::getAge).count(User::getName)` expecting field-based counting, but gets plain per-record counting with no warning. **Suggested fix direction:** 1. Either implement the selector logic (e.g., count only when selected field is non-null, or count distinct values) 2. Or deprecate/remove the parameter if the behavior is intentionally identical The exact semantics should be clarified with maintainers, but silently ignoring a parameter is definitely a defect. --- *Automated evaluation by RockteMQ-AI* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
