Skip to content

Commit

Permalink
pkg/query/table: Add comment about map check not panicking
Browse files Browse the repository at this point in the history
  • Loading branch information
metalmatze committed Aug 23, 2023
1 parent d342e10 commit da7d2be
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 1 addition & 0 deletions pkg/query/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func generateTableArrowRecord(
// Check if we've seen the address for the mapping before.
// If not, we add it as a new row and add the address to the mapping to keep track of it.
// If we have seen the address before, we merge the address with the existing row by summing the values.
// Note for Go developers: This won't panic. Tests have shown that if the first check fails, the second check won't be run.
if cr, ok := tb.addresses[unsafeString(buildID)][addr]; !ok {
if err := tb.appendRow(r, sampleRow, locationRow, -1, isLeaf); err != nil {
return nil, 0, err
Expand Down
3 changes: 0 additions & 3 deletions pkg/query/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package query

import (
"context"
"fmt"
"testing"

"github.com/apache/arrow/go/v13/arrow/array"
Expand Down Expand Up @@ -63,8 +62,6 @@ func TestGenerateTable(t *testing.T) {
symbolizedProfile, err := parcacol.NewProfileSymbolizer(tracer, metastore).SymbolizeNormalizedProfile(ctx, profiles[0])
require.NoError(t, err)

fmt.Println(profiles[0].Meta)

np, err := OldProfileToArrowProfile(symbolizedProfile)
require.NoError(t, err)

Expand Down

0 comments on commit da7d2be

Please sign in to comment.