apache / apache/parquet-java

checkBlockSizeReached zero record size perf issue

Open
#2,720 0 comments 0 reactions 0 assignees View on GitHub
Component: Java Component: Parquet Priority: Minor Type: bug
Dominant language
Java
Stars
3.1k
Forks
1.6k
Avg merge
3d 12h
Merged PRs (30d)
33

Description

Parquet checks Block size after writing records to decide when it shall flush. This is relatively expensive, so it estimates the next check based on record size, record count etc.

For small records (less than 1byte after compression), the average record size is 0 after integer division. This caused overflow when calculating the next record count for block size check, resulting block size being checked for every record.

**Reporter**: [Huicheng Song](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=songhuicheng)

**Note**: *This issue was originally created as [PARQUET-2199](https://issues.apache.org/jira/browse/PARQUET-2199). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing checkBlockSizeReached and the block-size estimation logic described in the issue. Reproduce the case with records smaller than one compressed byte, then verify that the calculation does not overflow and that block-size checks are not performed for every record.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data-engineering, performance
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.