Skip to content

Comet 1.1.0: FileSourceScanExec.copy NoSuchMethodError on EMR Spark 4.1.1 #7393

Open

Description

@danielwei816

Describe the bug

Hey! We're running Comet 1.1.0 on EMR Serverless and hitting a NoSuchMethodError when caching a query with Parquet inputs.

The failure is in CometNativeScanExec.doCanonicalize(). It calls FileSourceScanExec.copy() with 10 arguments, but EMR's Spark build has a 12-argument version of that method.

Environment:

  • EMR Serverless: emr-spark-8.1.0
  • Spark: 4.1.1-amzn-0
  • Comet: org.apache.datafusion:comet-spark-spark4.1_2.13:1.1.0
  • Java 17, ARM64
  • Comet enabled, native shuffle and native Iceberg writes disabled

The error:

java.lang.NoSuchMethodError: 'org.apache.spark.sql.execution.FileSourceScanExec org.apache.spark.sql.execution.FileSourceScanExec.copy(org.apache.spark.sql.execution.datasources.HadoopFsRelation, scala.Option, scala.collection.immutable.Seq, org.apache.spark.sql.types.StructType, scala.collection.immutable.Seq, scala.Option, scala.Option, scala.collection.immutable.Seq, scala.Option, boolean)'
    at org.apache.spark.sql.comet.CometNativeScanExec.doCanonicalize(CometNativeScanExec.scala:298)

Steps to reproduce

Our job joins Parquet inputs with Iceberg data, then calls:

changes.persist(StorageLevel.MEMORY_AND_DISK)

Spark fails while preparing the cached query. I haven't reduced the full query to a standalone PySpark reproducer yet, but the method mismatch can be checked directly against the public EMR image:

docker run --rm --entrypoint /bin/bash \
  public.ecr.aws/emr-serverless/spark4/emr-spark-8.1.0:20260827 \
  -c 'javap -classpath "/usr/lib/spark/jars/*" org.apache.spark.sql.execution.FileSourceScanExec | grep " copy("'

Compared with upstream Spark 4.1.1, EMR adds two fields after disableBucketedScan:

  • enablePushdownAggregate: Boolean
  • partitionOutput: Seq[Attribute]

The EMR JAR has the 12-argument copy() and no 10-argument overload. Comet's call here therefore can't resolve at runtime.

Expected behavior

Caching the query succeeds, or Comet falls back to Spark for this scan when the runtime is incompatible.

Additional context

I realize EMR changes Spark internals and isn't part of Comet's tested Spark matrix. I found #190 and the makeCopy() change in #207, which addressed a similar issue on Databricks. This looks like the same assumption in a different call site.

Would using makeCopy() with the runtime's existing field values be a reasonable fix here? We haven't tested that patch yet.

Activity

  1. added
    bugSomething isn't working
    priority:highCrashes, panics, segfaults, major functional breakage
    area:scanParquet scan / data reading
    and removed on Nov 2, 2026
  2. kazuyukitanimura commented on Nov 2, 2026

    @kazuyukitanimura
    Contributor

    Hi @danielwei816
    Thanks for reporting.
    If I understand correctly, emr-spark-8.1.0 is closed source. We cannot support such Spark. Wondering if AWS folks can step in and help, but we may be unable to test changes for such Spark fork.

  3. danielwei816 commented on Nov 2, 2026

    @danielwei816
    Author

    Thanks for looking into this. I understand the concern about maintaining and testing compatibility with vendor forks.

    Would you consider a focused fix using the existing makeCopy() approach from #207? That PR addressed a similar FileSourceScanExec signature mismatch on Databricks. This looks like another call site where preserving the runtime's existing fields could avoid the hard-coded copy() signature.

    I haven't tested that patch yet, but I can validate it against the public EMR image and on EMR Serverless, and share the reproducer and results. If the change also passes the upstream Spark tests, would you be open to accepting it while keeping the existing support policy?

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:scanParquet scan / data readingbugSomething isn't workingpriority:highCrashes, panics, segfaults, major functional breakagespark 4.1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions