agchang commented on code in PR #34808:
URL: https://github.com/apache/arrow/pull/34808#discussion_r1159030926


##########
go/parquet/file/file_reader_test.go:
##########
@@ -271,6 +286,31 @@ func (p *PageSerdeSuite) TestCompression() {
        }
 }
 
+func TestWithEOFReader(t *testing.T) {
+       sink := encoding.NewBufferWriter(0, memory.DefaultAllocator)
+       serializer := thrift.NewThriftSerializer()
+       fields := schema.FieldList{
+               schema.NewInt32Node("int_col", parquet.Repetitions.Required, 
-1),
+       }
+       root, _ := schema.NewGroupNode("schema", parquet.Repetitions.Repeated, 
fields, -1)
+       schema := schema.NewSchema(root)
+       props := 
parquet.NewWriterProperties(parquet.WithVersion(parquet.V2_LATEST))
+       builder := metadata.NewFileMetadataBuilder(schema, props, nil)
+       fileMetaData, _ := builder.Finish()
+
+       size, _ := serializer.Serialize(fileMetaData, sink, nil)
+
+       binary.Write(sink, binary.LittleEndian, uint32(size))
+       magic := []byte("PAR1")
+       sink.Write(magic)
+       buf := sink.Finish()
+       defer buf.Release()

Review Comment:
   Appreciate the help! Much cleaner. Done.



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