Skip to content

Commit

Permalink
wipe nested set model fields (#2729)
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Elliott <[email protected]>
  • Loading branch information
joe-elliott authored Jul 28, 2023
1 parent f34ee86 commit cfb6e54
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tempodb/encoding/vparquet2/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ func traceToParquet(id common.ID, tr *tempopb.Trace, ot *Trace) *Trace {
eventToParquet(e, &ss.Events[ie])
}

// nested set values do not come from the proto, they are calculated
// later. set all to 0
ss.NestedSetLeft = 0
ss.NestedSetRight = 0
ss.ParentID = 0

ss.SpanID = s.SpanId
ss.ParentSpanID = s.ParentSpanId
ss.Name = s.Name
Expand Down
6 changes: 6 additions & 0 deletions tempodb/encoding/vparquet3/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,12 @@ func traceToParquet(meta *backend.BlockMeta, id common.ID, tr *tempopb.Trace, ot
eventToParquet(e, &ss.Events[ie])
}

// nested set values do not come from the proto, they are calculated
// later. set all to 0
ss.NestedSetLeft = 0
ss.NestedSetRight = 0
ss.ParentID = 0

ss.SpanID = s.SpanId
ss.ParentSpanID = s.ParentSpanId
ss.Name = s.Name
Expand Down
1 change: 1 addition & 0 deletions tempodb/encoding/vparquet3/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func TestFieldsAreCleared(t *testing.T) {
// a minimal trace to make sure nothing bleeds through
tr := &Trace{}
_ = traceToParquet(&meta, traceID, complexTrace, tr)

parqTr := traceToParquet(&meta, traceID, simpleTrace, tr)
actualTrace := parquetTraceToTempopbTrace(&meta, parqTr)
require.Equal(t, simpleTrace, actualTrace)
Expand Down

0 comments on commit cfb6e54

Please sign in to comment.