Skip to content

Spark 4.1: native parquet reader returns wrong rows for user-defined struct schema #4192

Closed

Description

@andygrove

Sub-issue of #4098.

Description

Two tests fail in both `Spark 4.1, JDK 17/auto [parquet]` (Linux) and `macos-14/Spark 4.1, JDK 17, Scala 2.13 [parquet]`:

  • `native reader - select struct field with user defined schema - native_datafusion`
  • `native reader - select struct field with user defined schema - native_iceberg_compat`

Symptom: `Results do not match for query`. The schema involved is `c0: struct<y:int,x:string>` over a parquet relation. Comet's native reader returns different rows than Spark.

Suspected root cause

Spark 4.1 likely changed how user-supplied struct schemas are reconciled with on-disk Parquet field order, or field pruning behaves differently. Compare Spark 4.0 vs 4.1 planning output for this query and check whether user-schema field-name-vs-position behavior changed in `ParquetReadSupport` or `ParquetSchemaConverter`.

Where

The test currently has `assume(!isSpark41Plus, "https://github.com/apache/datafusion-comet/issues/4098")\` in `spark/src/test/scala/org/apache/comet/exec/CometNativeReaderSuite.scala` (test name "native reader - select struct field with user defined schema").

Activity

  1. added
    bug
    on May 3, 2026
  2. added
    priority:critical
    area:scan
    native_datafusion
    native_iceberg_compat
    and removed on May 4, 2026
  3. andygrove commented on May 11, 2026

    @andygrove
    MemberAuthor

    This was fixed recently

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

    area:scanbugcorrectnessnative_datafusionnative_iceberg_compatpriority:criticalspark 4.1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions