Skip to content

[SNOW-3883414] verify() wraps ParquetDecodingException - #1165

Merged
yelgabra merged 3 commits into
masterfrom
yelgabra-SNOW-3883414-verify-wraps-decode-exception
Aug 27, 2026
Merged

[SNOW-3883414] verify() wraps ParquetDecodingException#1165
yelgabra merged 3 commits into
masterfrom
yelgabra-SNOW-3883414-verify-wraps-decode-exception

Conversation

@yelgabra

@yelgabra yelgabra commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Bug: verify(), introduced in [SNOW-3883414 parquet compression corruption check](#1162), expected BdecParquetReader.read() to return IOException when reading a corrupted BDEC file, but read() actually returns ParquetDecodingException when the BDEC body is corrupted.

testParquetReadBackVerificationCatchesCorruption() passed previously as the midpoint calculation returned a point in the footer instead of body, leading to an IOException accidentally.

Impact: the verifier would still successfully block corrupted BDEC uploads, which is an improvement on previous behaviour where we upload corrupted files. But it would not retry compressing them.

This PR modifies verify to catch ParquetDecodingException and fixes the test to properly test the verifier

Page/GZIP corruption is thrown unchecked, so verifyReadBack skipped the
3 rewrite retries. Catch it in verify() as IOException. Expand the
corruption test so midpoint XOR actually hits the compressed page.
@yelgabra
yelgabra requested review from a team as code owners August 26, 2026 19:56
@yelgabra
yelgabra requested a review from sfc-gh-ggeng August 26, 2026 19:57
@yelgabra yelgabra changed the title Yelgabra snow 3883414 verify wraps decode exception [SNOW-3883414] verify() wraps ParquetDecodingException Aug 26, 2026
String.format(
"Row count mismatch: expected %d, got %d", expectedRowCount, actualRowCount));
}
} catch (ParquetDecodingException e) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you check if there can be other exceptions? should we just catch all exception here?

try (BdecParquetReader reader = new BdecParquetReader(data)) {
while (reader.read() != null) {
actualRowCount++;
try {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this second try clause?

@sfc-gh-ggeng sfc-gh-ggeng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some comments, please check

Catch RuntimeException instead of only ParquetDecodingException so footer
and page-body corruption both retry. Restore the original midpoint XOR
test with a 16-byte window, and add a page-body case that is stable across
4.4.4 and 4.4.4-SNAPSHOT.
@yelgabra
yelgabra enabled auto-merge (squash) August 27, 2026 00:33
@yelgabra
yelgabra merged commit 7c5641c into master Aug 27, 2026
46 of 51 checks passed
@yelgabra
yelgabra deleted the yelgabra-SNOW-3883414-verify-wraps-decode-exception branch August 27, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants