Skip to content

Commit

Permalink
Try zero value envelope
Browse files Browse the repository at this point in the history
  • Loading branch information
masih committed Oct 29, 2024
1 parent fadedfc commit a811974
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cmd/f3/msgdump/parquet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,27 @@ func TestOpenAndWriteParquetFile(t *testing.T) {
require.NoError(t, reader.Close())
}()
}

func TestZeroValueEnvelope(t *testing.T) {
pw, err := NewParquetWriter[ParquetEnvelope](t.TempDir())
require.NoError(t, err)

var gEnvelope GMessageEnvelope
row, err := ToParquet(gEnvelope)
require.NoError(t, err)
_, err = pw.Write(row)
require.NoError(t, err)
_, err = pw.Write(row)
require.NoError(t, err)
name := strings.ReplaceAll(pw.FileName(), ".partial", "")
require.NoError(t, pw.Close())

open, err := os.Open(name)
require.NoError(t, err)

reader := parquet.NewReader(open)
require.EqualValues(t, 2, reader.NumRows())
defer func() {
require.NoError(t, reader.Close())
}()
}

0 comments on commit a811974

Please sign in to comment.