Repository navigation
Description
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: BooleanpartitionOutput: 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
kazuyukitanimura commentedon Nov 2, 2026
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.
kazuyukitanimura commentedon Nov 2, 2026
https://github.com/apache/datafusion-comet/blob/main/docs/source/about/faq.md#does-comet-work-with-vendor-distributions-of-spark
danielwei816 commentedon Nov 2, 2026
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 similarFileSourceScanExecsignature mismatch on Databricks. This looks like another call site where preserving the runtime's existing fields could avoid the hard-codedcopy()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?