diff --git a/go/parquet/file/file_writer.go b/go/parquet/file/file_writer.go index 48eb8f44d167b..1d7f7840dac50 100644 --- a/go/parquet/file/file_writer.go +++ b/go/parquet/file/file_writer.go @@ -121,6 +121,7 @@ func (fw *Writer) AppendRowGroup() SerialRowGroupWriter { func (fw *Writer) appendRowGroup(buffered bool) *rowGroupWriter { if fw.rowGroupWriter != nil { + fw.nrows += fw.rowGroupWriter.nrows fw.rowGroupWriter.Close() } fw.rowGroups++ diff --git a/go/parquet/file/file_writer_test.go b/go/parquet/file/file_writer_test.go index beceff9732584..f32e403a8d534 100644 --- a/go/parquet/file/file_writer_test.go +++ b/go/parquet/file/file_writer_test.go @@ -97,6 +97,8 @@ func (t *SerializeTestSuite) fileSerializeTest(codec compress.Compression, expec writer.Close() nrows := t.numRowGroups * t.rowsPerRG + t.EqualValues(nrows, writer.NumRows()) + reader, err := file.NewParquetReader(bytes.NewReader(sink.Bytes())) t.NoError(err) t.Equal(t.numCols, reader.MetaData().Schema.NumColumns())