Skip to content

Page-index pruning can drop rows for INT32/INT64-encoded decimals #3264

Closed

Description

@anoopj

Apache Iceberg Rust version

main @ e694eea

Describe the bug

Surfaced during #3247 (review)

PageIndexEvaluator::apply_predicate_to_column_index constructs INT32 and INT64 page bounds as PrimitiveLiteral::Int and PrimitiveLiteral::Long, regardless of the Iceberg field type.

For decimal fields, query datums use PrimitiveLiteral::Int128. Datum::partial_cmp only compares decimal datums when both literals are Int128, so comparisons between these page bounds and query datums return None.

This can silently prune matching pages when page-index row selection is enabled:

  • Inequality predicates (<, <=, >, >=) treat the failed comparison as false and reject the page.
  • IN can conclude that no literal is within the page bounds and reject the page.
  • Equality currently fails open and retains the page.

The row-group statistics path already handles these encodings correctly: get_parquet_stat_min_as_datum (and max) convert decimal Statistics::Int32 and Statistics::Int64 values to PrimitiveLiteral::Int128.

Parquet commonly encodes decimal precision ≤9 as INT32 and precision 10–18 as INT64, including files produced by the current Arrow/Parquet writer.

Fix direction: when the Iceberg field type is decimal, convert INT32/INT64 page-index bounds to Int128, matching the row-group statistics path. Add regression coverage for inequality and IN predicates with row selection enabled.

To Reproduce

No response

Expected behavior

No response

Willingness to contribute

I can contribute a fix for this bug independently

Activity

  1. added
    bug
    on Sep 22, 2026
  2. added a commit that references this issue on Oct 2, 2026
    ffa864b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions