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

   ## What
   
   Two correctness fixes in the trace query response path:
   
   1. **Identity-tag projection.** When a trace query explicitly projects 
`trace_id` or `span_id`, those identity tags were requested from storage as 
ordinary projected tags. They are not stored as regular tag columns — they are 
reconstructed from the span identity at response-build time, so projecting them 
produced incorrect results. This omits them from the storage-level tag 
projection in both the standalone query path (`omitIdentityTagProjection` in 
`banyand/trace/query.go`) and the logical plan 
(`omitIdentityProjectionTagNames` in `trace_plan_tag_filter.go`), and guards 
`blockCursor.copyAllTo` against an empty projection.
   
   2. **Distributed span tag alignment.** `distributedTraceResultIterator.Next` 
aggregated per-span tags through a Go map, which (a) lost deterministic tag 
order and (b) misaligned a tag's values when some spans lacked that tag. It now 
preserves first-seen tag order and null-fills missing per-span values, so every 
tag column stays positionally aligned with the span list.
   
   ## Tests
   
   - `TestOmitIdentityTagProjection` (`banyand/trace/query_test.go`)
   - `TestDistributedTraceResultIteratorPreservesTagOrderAndSpanAlignment` 
(`pkg/query/logical/trace/trace_plan_distributed_test.go`)
   - Existing `banyand/trace` and `pkg/query/logical/trace` unit tests pass.
   
   ## Notes
   
   Surfaced by explicit-projection and multi-span trace query cases. CHANGES.md 
updated.
   


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

Reply via email to