fix owhanging crashes in parquet S3 select (#9921)

This commit is contained in:
Klaus Post
2020-07-01 08:15:41 -07:00
committed by GitHub
parent 5089a7167d
commit 2e338e84cb
3 changed files with 82 additions and 11 deletions

View File

@@ -17,6 +17,7 @@
package parquet
import (
"errors"
"io"
"strings"
@@ -34,6 +35,9 @@ func getColumns(
nameIndexMap := make(map[string]int)
for colIndex, columnChunk := range rowGroup.GetColumns() {
meta := columnChunk.GetMetaData()
if meta == nil {
return nil, errors.New("parquet: column metadata missing")
}
columnName := strings.Join(meta.GetPathInSchema(), ".")
if columnNames != nil && !columnNames.Contains(columnName) {
continue
@@ -50,7 +54,9 @@ func getColumns(
}
size := meta.GetTotalCompressedSize()
if size < 0 {
return nil, errors.New("parquet: negative compressed size")
}
rc, err := getReaderFunc(offset, size)
if err != nil {
return nil, err