Skip to content

Native Iceberg Parquet scans ignore initial-default values #2726

Open

Description

@Sigma-Ma

Describe the bug

Native Iceberg Parquet scans do not honor non-null initial-default values for columns absent from older data files.

Auron returns NULL for those columns and evaluates predicates using NULL, producing incorrect projections, missing matching rows, and extra rows for IS NULL.

To Reproduce

Using Spark 3.5.8, Scala 2.12.18, JDK 17, and Iceberg 1.10.1:

  1. Create an unpartitioned Iceberg table with id INT, format version 3, and Parquet data files.
  2. Write id = 1 before adding the new column.
  3. Add an optional country column through the Iceberg API: table.updateSchema().addColumn("country", Types.StringType.get(), Expressions.lit("US")).commit().
  4. Refresh the table and append (2, 'US'), (3, NULL), and (4, 'CA').

The Parquet footers were checked: the old file lacks the new field ID, while the new files contain it.

Query Expected Native actual
SELECT id, country (1,US), (2,US), (3,NULL), (4,CA) (1,NULL), (2,US), (3,NULL), (4,CA)
SELECT id WHERE country = 'US' 1,2 2
SELECT id WHERE country IS NULL 3 1,3
SELECT id WHERE country IS NOT NULL 1,2,4 2,4
SELECT id WHERE upper(country) = 'US' 1,2 2

These queries execute NativeIcebergTableScan. Unaffected projections and missing columns without a non-null initial default behave correctly.

Expected behavior

Honor initial defaults when a field ID is physically absent from a file, while preserving physically present NULL values.

Propagate typed initial defaults to the native reader and apply them consistently in missing-column materialization and predicate adaptation.

The initial scope is top-level primitive fields in delete-free Parquet scans, without upgrading Iceberg.

Screenshots

N/A.

Additional context

The pinned Iceberg 1.10.1 reader also has a filtering defect addressed by apache/iceberg#16692, so Auron-disabled results cannot be the only oracle.

All checks use explicit expected results. A runtime comparison with Iceberg 1.12.0 makes the Iceberg row and vectorized reader checks pass, while Auron retains the same five native failures.

This proposal addresses Auron's native reader. Fixing the upstream Iceberg 1.10.1 reader and supporting nested defaults or other file formats are separate work.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions