diff --git a/file.go b/file.go index 164c517..0dcbb1a 100644 --- a/file.go +++ b/file.go @@ -174,6 +174,10 @@ func OpenFile(r io.ReaderAt, size int64, options ...FileOption) (*File, error) { // this case the page index is not cached within the file, programs are expected // to make use of independently from the parquet package. func (f *File) ReadPageIndex() ([]format.ColumnIndex, []format.OffsetIndex, error) { + if len(f.metadata.RowGroups) == 0 { + return nil, nil, nil + } + columnIndexOffset := f.metadata.RowGroups[0].Columns[0].ColumnIndexOffset offsetIndexOffset := f.metadata.RowGroups[0].Columns[0].OffsetIndexOffset columnIndexLength := int64(0) diff --git a/testdata/empty.parquet b/testdata/empty.parquet new file mode 100644 index 0000000..e36cbef Binary files /dev/null and b/testdata/empty.parquet differ