fix: broken gzip handling with Select API (#9128)

This PR fixes a regression introduced in a1c7c9ea73
master
Harshavardhana 5 years ago committed by GitHub
parent a54cdb9587
commit 603cf2a8bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      pkg/s3select/progress.go

@ -100,12 +100,13 @@ func newProgressReader(rc io.ReadCloser, compType CompressionType) (*progressRea
case noneType: case noneType:
r = scannedReader r = scannedReader
case gzipType: case gzipType:
if r, err = gzip.NewReader(scannedReader); err != nil { r, err = gzip.NewReader(scannedReader)
if err != nil {
if errors.Is(err, gzip.ErrHeader) || errors.Is(err, gzip.ErrChecksum) { if errors.Is(err, gzip.ErrHeader) || errors.Is(err, gzip.ErrChecksum) {
return nil, errInvalidGZIPCompressionFormat(err) return nil, errInvalidGZIPCompressionFormat(err)
} }
return nil, errTruncatedInput(err)
} }
return nil, errTruncatedInput(err)
case bzip2Type: case bzip2Type:
r = bzip2.NewReader(scannedReader) r = bzip2.NewReader(scannedReader)
default: default:

Loading…
Cancel
Save