Skip to content

GH-55948: [C++][Dataset][Parquet] Preserve signed-zero bounds in predicate pushdown - #55954

Open
valleysonata wants to merge 2 commits into
apache:mainfrom
valleysonata:fix/parquet-signed-zero-pushdown
Open

valleysonata wants to merge 2 commits into
apache:mainfrom
valleysonata:fix/parquet-signed-zero-pushdown

Conversation

@valleysonata

Copy link
Copy Markdown

Closes #55948.

Rationale

Parquet statistics can store a minimum of -0.0 and a maximum of +0.0 for a row group containing positive zeros. Treating those bounds as a single value lets filter simplification substitute negative zero and incorrectly skip matching rows.

Changes

Distinguish the signs of zero when deciding whether the bounds represent a single value. If the signs differ, retain the range guarantee. Add a regression test for a reciprocal filter on a row group containing positive zero.

Tests

All 61 tests in arrow-dataset-file-parquet-test passed, including the new regression in threaded and serial scans. A separate focused check showed the original code simplified the predicate to false; the fix preserves the predicate.

User-facing changes

Critical Fix: Sign-sensitive Parquet filters no longer drop matching rows in this case. No API changes.

Was AI used for this PR?

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

AI helped prepare the patch, regression test, and description. The contributor reviewed the patch.

Do not turn Parquet bounds spanning both signs of zero into a single-value guarantee.
Check that a reciprocal filter retains a Parquet row group containing +0.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++][Dataset][Parquet] Row group of +0.0 values is skipped: statistics (-0.0, +0.0) become the guarantee x == -0.0

1 participant