daniel-adam-tfs commented on code in PR #596:
URL: https://github.com/apache/arrow-go/pull/596#discussion_r2707593143
##########
parquet/file/page_reader.go:
##########
@@ -812,15 +855,16 @@ func (p *serializedPageReader) Next() bool {
return false
}
- if compressed {
- if levelsBytelen > 0 {
- io.ReadFull(p.r,
buf.Bytes()[:levelsBytelen])
- }
- if _, p.err = p.decompress(p.r,
lenCompressed-levelsBytelen, buf.Bytes()[levelsBytelen:]); p.err != nil {
+ if p.cryptoCtx.DataDecryptor != nil {
+ if err := p.readV2Encrypted(p.r, lenCompressed,
levelsBytelen, compressed, buf.Bytes()); err != nil {
+ p.err = err
return false
}
} else {
- io.ReadFull(p.r, buf.Bytes())
+ if err := p.readV2Unencrypted(p.r,
lenCompressed, levelsBytelen, compressed, buf.Bytes()); err != nil {
+ p.err = err
+ return false
+ }
}
Review Comment:
Not quite, the compressed branch had an issue as well. It must decrypt the
whole buffer with data first, then it can read the levels and decompress the
values.
--
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]