hcrosse commented on code in PR #1585:
URL: https://github.com/apache/arrow-go/pull/1585#discussion_r4591527516


##########
parquet/file/column_reader_test.go:
##########
@@ -507,6 +508,64 @@ func TestSkipEmptyRepeatedRows(t *testing.T) {
        assert.Equal(t, []int16{0}, reps)
 }
 
+func TestSkipStopsAtDecodeError(t *testing.T) {
+       mem := memory.NewCheckedAllocator(memory.NewGoAllocator())
+       defer mem.AssertSize(t, 0)
+
+       node, err := schema.NewPrimitiveNode("value", 
parquet.Repetitions.Required, parquet.Types.ByteArray, -1, -1)
+       require.NoError(t, err)
+       descr := schema.NewColumn(node, 0, 0)
+
+       // the length prefix runs past the data, so only decoding fails
+       body := memory.NewBufferBytes([]byte{3, 0, 0, 0, 'a'})
+       page := file.NewDataPageV1(body, 20, parquet.Encodings.Plain, 
parquet.Encodings.RLE, parquet.Encodings.RLE, int32(body.Len()))
+       defer page.Release()
+
+       pages := new(testutils.MockPageReader)
+       pages.Test(t)
+       pages.TestData().Set("pages", []file.Page{page})
+       pages.On("Err").Return((error)(nil))
+       r := file.NewColumnReader(descr, pages, mem, 
nil).(*file.ByteArrayColumnChunkReader)
+       defer r.Close()
+
+       n, err := r.Skip(10)
+       require.Error(t, err)
+       assert.Less(t, n, int64(10))

Review Comment:
   Woops, ty for catching it



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