Skip to content

Preserve physical leaf identity for duplicate primitive root paths #3795

Description

@ErikBPF

Problem

Duplicate primitive root names can lose physical column identity when converting the footer and selecting pages/indexes. Name-path lookup can assign the later root's primitive type to an earlier physical column, while path-keyed page/index storage can replace an earlier chunk with a later one.

Original consumer report and standalone Rust fixture plus Spark reproduction: apache/datafusion-comet#5964. Its Spark 4.1.3 vectorized, separate single-field-ID reads over INT64/id1 followed by INT32/id2 produce an anomalous zero. That report is not a claim of general duplicate-name support or a proposed requirement to reproduce the zero.

Proposed bounded fix

Associate footer column metadata with schema leaves by physical ordinal and validate available path/type and column count before using them. For duplicate primitive root paths, preserve the first selected page chunk and its matching column index. Keep column-key decryption lazy. Nested duplicate resolution, encrypted duplicate reads, simultaneous aliases, and nonvectorized consumer duplicate reads are outside this proposal.

Reproduction in the proposed owner test

TestDuplicateRootIdentity writes normal Parquet pages, then renames the second physical root in the Thrift footer to match the first. It deliberately gives the two roots different physical types and page layouts. Tests check first-root index selection, partial-row-group reads filtered on another column, nested nonduplicate ordinal controls, malformed column counts/path/types, empty projections, and deferred key retrieval. No external binary fixture is required.

The proposed port targets current master, not the older 1.16.0 release used during initial consumer investigation. The owner module and required upstream modules have been built on JDK 17 with Thrift 0.24.0; 112 targeted tests pass. Full reactor suites remain unrun.

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