Repository navigation
Support __count__ sentinel in AGG view to delegate to native COUNT query - #387
Merged
Merged
Conversation
…UNT query
- Add Constants.Group.COUNT_SENTINEL ("__count__") as a reserved group name
- QueryService.agg() detects the sentinel and delegates to the native
edge-count path (TableBinding.count), mapping EdgeCountPayload ->
EdgeAggPayload (count field -> value field)
- require(ranges == null) when group is __count__; ranges is not meaningful
for a count query and would otherwise be silently ignored
- Make ranges nullable in QueryService.agg() and EdgeQueryController.agg();
non-sentinel groups still require ranges (enforced via requireNotNull)
- Add E2E tests covering OUT/IN counts, multi-start, ranges-rejection,
and missing-group validation
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Happy <[email protected]>
__count__ sentinel in AGG view to delegate to native COUNT query__count__ sentinel in AGG view to delegate to native COUNT query
- Add start field assertion to OUT/IN count tests - Compare agg __count__ value against native /edges/count as ground truth, instead of hardcoded expected values (embedded MockHTable does not increment counters via batch, so both paths return the same implementation-consistent value) - Multi-start test now asserts per-node value for each start key - Replace no_such_group regression with by_category (a real schema group), which correctly exercises the requireNotNull(ranges) path Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <[email protected]> Co-Authored-By: Happy <[email protected]>
eazyhozy
marked this pull request as ready for review
June 30, 2026 04:55
Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <[email protected]> Co-Authored-By: Happy <[email protected]>
Member
Author
|
@em3s Could you take a look when you have a moment? This PR adds |
Contributor
|
LGTM. Nit: consider rejecting group names that start with _ (or the sentinel itself) at schema creation time. Nice work @eazyhozy ! |
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
__count__as a reserved sentinel group name in the AGG endpoint (GET .../edges/agg/{group}). When the group is__count__, the request is internally delegated to the existing native edge-count query instead of looking up a pre-defined aggregation group in table metadata.Part of #369
Changes
core/.../Constants.kt— addConstants.Group.COUNT_SENTINEL = "__count__"alongside the existing reserved-marker convention (VERTEX_MARKER)engine/.../service/QueryService.kt— detect__count__inagg(), delegate tocounts()(native HBase counter path), and mapDataFrameEdgeCountPayload→DataFrameEdgeAggPayload(countfield →valuefield). Addrequire(ranges == null)guard for the sentinel path. Makerangesnullable; non-sentinel groups enforce non-null viarequireNotNull.server/.../EdgeQueryController.kt— make@RequestParam rangesnullable (defaultnull) so callers can omit it when using__count__server/.../EdgeAggCountSentinelE2ETest.kt— 5 E2E test cases (first E2E coverage for the/edges/agg/{group}endpoint):start,direction, andvaluefields;valueis compared against/edges/countas ground truth so the two paths are verified to be consistentvaluefor each start keyranges+__count__→ 400by_category) withoutranges→ 400 (exercises therequireNotNull(ranges)path)TableBindinginterface is unchanged — all binding implementations benefit automatically.How to Test
./gradlew :server:test --tests "*.EdgeAggCountSentinelE2ETest"Or end-to-end against a running server:
AI Assistance