You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "hanahmily (via GitHub)" <gi...@apache.org> on 2026/09/17 10:44:46 UTC

[I] [Feature] BanyanDB: tag aggregation API foundation + binding for existing aggregate functions [skywalking]

hanahmily opened a new issue, #14088:
URL: https://github.com/apache/skywalking/issues/14088

   Part 1 of 5 of the [tag aggregation and time bucketing design](https://github.com/apache/skywalking-banyandb/blob/main/docs/design/0.12.0/tag-aggregation/README.md), shipped in apache/skywalking-banyandb#1360.
   
   **Design references:** [§5.1 Proto](https://github.com/apache/skywalking-banyandb/blob/main/docs/design/0.12.0/tag-aggregation/README.md#51-proto) · [§6 Semantics](https://github.com/apache/skywalking-banyandb/blob/main/docs/design/0.12.0/tag-aggregation/README.md#6-semantics) · [§7.1 Binding the target to a column](https://github.com/apache/skywalking-banyandb/blob/main/docs/design/0.12.0/tag-aggregation/README.md#71-binding-the-target-to-a-column) · [§12 Delivery order](https://github.com/apache/skywalking-banyandb/blob/main/docs/design/0.12.0/tag-aggregation/README.md#12-delivery-order) (stages 0–1)
   
   **Depends on:** none — this is the foundation the other 4 issues in this series build on.
   
   ## Scope
   
   **Proto/model** (design §5.1)
   - `AGGREGATION_FUNCTION_COUNT_DISTINCT` in `api/proto/banyandb/model/v1/common.proto`.
   - `Aggregation.tag_name` + `Aggregation.tag_family` on `QueryRequest.Aggregation`.
   - `GroupBy.TimeBucket.width` + `GroupBy.time_bucket` on `QueryRequest.GroupBy`.
   - `model.MeasureAgg` gains `TagName`/`TagFamily`/`HideTag`; `model.MeasureGroupBy` gains the bucket width.
   - These are wire-additive only — no analyzer/execution behavior changes in this issue. Regenerate via `make -C api generate` (`docs/api-reference.md` regenerates with it, never hand-edited).
   
   **Tag binding for the five existing functions** (design §6, §7.1)
   - `plan/analyzer.go` `translateAgg` resolves a tag *or* field target, enforcing the §6 type matrix for `SUM/MIN/MAX/MEAN/COUNT` (the `COUNT_DISTINCT` matrix row is a later issue in this series).
   - `ensureAggFieldProjected` injects the tag into the projection when the caller didn't request it, setting `HideTag`.
   - `integration.go` `buildNativeTagSet` includes the agg tag so it's a native typed column, not a `ColumnTypeTagValue` passthrough — load-bearing, since `fold` hard-casts to a typed column with no fallback.
   - `plan.go` `lookupFieldColumnIndex` gains a tag sibling resolving on `(RoleTag, TagFamily, Name)`.
   - `aggregation.go` `fold`: `COUNT` gets a null-check-only branch so it works over non-numeric columns without parsing the value.
   - `aggregation.go` `collectTagIndices` gains an exclusion index so a `HideTag` target isn't also emitted as a first-seen tag.
   - `keyComponentSupported(ColumnType) bool` next to `appendKeyComponent`, used by the analyzer's rejection list, so the analyzer's assumption and the operator's behavior can't drift apart.
   
   ## Out of scope
   - `COUNT_DISTINCT` — separate issue in this series.
   - Time-bucket grouping — separate issue in this series.
   - Everything downstream of `AggSpec.InputCol` for the five existing functions needs *no* execution change — the partial stays a `RoleField` scalar column, so this issue is standalone-and-distributed by construction, not by extra work.
   
   ## Test / Definition of done
   - Wire round-trip: an old client that never sets the new fields is unaffected; new fields survive encode/decode.
   - Full §6 matrix for the five existing functions: array tag reject, timestamp tag reject, numeric functions over string/bytes tag reject, both `field_name`/`tag_name` set reject, neither set reject.
   - Each of the five functions over an `INT` tag; `COUNT` over a string tag; null values excluded; `MEAN` over an INT tag yields float64.
   - Result column inherits the tag's name (existing naming rule, extended); a `HideTag` target isn't double-emitted.
   - Standalone vs. distributed: same query/fixture returns the same numbers.


-- 
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: notifications-unsubscribe@skywalking.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Feature] BanyanDB: tag aggregation API foundation + binding for existing aggregate functions [skywalking]

Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily closed issue #14088: [Feature] BanyanDB: tag aggregation API foundation + binding for existing aggregate functions
URL: https://github.com/apache/skywalking/issues/14088


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org