mirror of
https://github.com/minio/minio.git
synced 2025-11-27 12:53:45 -05:00
fix owhanging crashes in parquet S3 select (#9921)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user