zeroshade commented on code in PR #596:
URL: https://github.com/apache/arrow-go/pull/596#discussion_r2699943746
##########
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:
So the issue is simply that we're not passing uncompressed v2 through the
decryptor right?
Wouldn't a simpler solution here just be to add the decryption check to the
non-compressed branch?
i.e. since the call to `decompress` will already decrypt the data, we just
need to replace the `io.ReadFull(p.r, buf.Bytes())` with code to check if we
need to decrypt and then decrypt it here, otherwise just leave the
`io.ReadFull` right?
--
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]