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/04/24 02:22:45 UTC

[PR] docs: add write specifications, server-generated element ID, and query deduplication [skywalking-banyandb]

hanahmily opened a new pull request, #1089:
URL: https://github.com/apache/skywalking-banyandb/pull/1089

   ## Summary
   - Add write specifications overview for Stream and Trace models in client docs
   - Document server-generated element ID behavior for stream writes
   - Document automatic query deduplication by element ID in stream queries
   
   ## Test plan
   - [x] Verified server-generated element ID behavior matches proto definitions
   - [x] Verified query deduplication exists in stream query implementation
   - [x] Removed inaccurate `bydbctl stream write`/`bydbctl trace write` examples (these commands do not exist in the CLI)
   - [x] Cross-references between client.md and stream.md are consistent
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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


Re: [PR] docs: add write specifications, server-generated element ID, and query deduplication [skywalking-banyandb]

Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily merged PR #1089:
URL: https://github.com/apache/skywalking-banyandb/pull/1089


-- 
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


Re: [PR] docs: add write specifications, server-generated element ID, and query deduplication [skywalking-banyandb]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #1089:
URL: https://github.com/apache/skywalking-banyandb/pull/1089#discussion_r3135366886


##########
docs/interacting/client.md:
##########
@@ -18,3 +18,8 @@ For stream writes, `element_id` is optional.
 - If the client omits `element_id`, BanyanDB generates a server-side element ID for that write. This is convenient for append-only ingestion, but repeated writes without a stable `element_id` are treated as different elements.
 
 See [Query Streams](./bydbctl/query/stream.md#element-identity-and-deduplication) for how element identity affects query results.
+See [Server-Generated Element ID](./bydbctl/schema/stream.md#server-generated-element-id) for writing stream data without an explicit element ID.
+
+## Write Specifications
+
+As of 0.10.0, BanyanDB supports writing data with specifications for [Stream](../concept/data-model.md#streams) and [Trace](../concept/data-model.md#traces) models. Write specifications allow clients to include metadata alongside data in a write request, enabling the server to better route and validate the write operation.

Review Comment:
   The new "Write Specifications" paragraph says specs are supported for Stream and Trace only, but Measure writes also support specs (see `banyandb.measure.v1.WriteRequest.data_point_spec`). Also, the spec fields describe tag/field ordering (schema mapping), not additional "metadata". Suggest expanding this to include Measure and tightening the wording to avoid implying extra metadata is carried.
   ```suggestion
   As of 0.10.0, BanyanDB supports write specifications for [Stream](../concept/data-model.md#streams), [Measure](../concept/data-model.md#measures), and [Trace](../concept/data-model.md#traces) models. These specifications describe how the write payload maps to the schema, such as tag and field ordering, enabling the server to correctly interpret and validate the write operation.
   ```



##########
docs/interacting/bydbctl/schema/stream.md:
##########
@@ -114,6 +114,16 @@ List operation list all streams' schema in a group.
 bydbctl stream list -g default
 ```
 
+## Server-Generated Element ID
+
+When writing stream data, the `element_id` field in the write request is optional. If omitted, the server generates a unique element ID automatically. This simplifies client code when stable element IDs are not required.
+
+## Query Deduplication
+
+Stream queries deduplicate results by element ID across the scan, merge, and result building stages. This ensures that each element appears only once in query results, even if the underlying storage or replication causes the same element to be read from multiple sources.
+
+This deduplication is automatic and requires no configuration. Users benefit from cleaner query results without needing to handle duplicates in client code.
+

Review Comment:
   This "Query Deduplication" content largely overlaps with the existing explanation in `docs/interacting/bydbctl/query/stream.md#element-identity-and-deduplication`. Duplicating the behavior description across two pages increases the risk of the docs drifting out of sync; consider replacing this with a short cross-reference to the query doc (or moving this section there).
   ```suggestion
   For details about stream query deduplication and element identity, see [Element Identity and Deduplication](../query/stream.md#element-identity-and-deduplication).
   ```



##########
docs/interacting/bydbctl/schema/stream.md:
##########
@@ -114,6 +114,16 @@ List operation list all streams' schema in a group.
 bydbctl stream list -g default
 ```
 
+## Server-Generated Element ID
+
+When writing stream data, the `element_id` field in the write request is optional. If omitted, the server generates a unique element ID automatically. This simplifies client code when stable element IDs are not required.
+

Review Comment:
   This section discusses server-generated `element_id`, but the StreamService `WriteResponse` does not include the generated ID. Without calling this out, readers may assume they can retrieve/use the generated ID for later retries or correlation. Consider explicitly noting that the generated element ID is server-side only (and if clients need a stable ID, they must set `element_id` themselves).
   ```suggestion
   
   Note that this generated `element_id` is server-side only. The StreamService `WriteResponse` does not return the generated ID, so clients cannot rely on retrieving it later for correlation, retries, or idempotent writes. If a client needs a stable or externally known element ID, it must set `element_id` explicitly in the write request.
   ```



-- 
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