Repository navigation
NoSuchMethodError: java.lang.Object org.apache.spark.executor.TaskMetrics.withExternalAccums(scala.Function1) #1576
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Running on Spark 3.5.0, Java 11, scala 2.12.18 on GCP Dataproc Cluster.
Can confirm Comet initialization
Acc to Spark History Server- this failed on a .count() operation in my code
Here's the full stack trace
java.lang.NoSuchMethodError: 'java.lang.Object org.apache.spark.executor.TaskMetrics.withExternalAccums(scala.Function1)'
at org.apache.spark.sql.comet.shims.ShimTaskMetrics$.getTaskAccumulator(ShimTaskMetrics.scala:30)
at org.apache.spark.sql.comet.shims.ShimTaskMetrics.getTaskAccumulator(ShimTaskMetrics.scala)
at org.apache.comet.parquet.BatchReader.init(BatchReader.java:350)
at org.apache.comet.parquet.CometParquetFileFormat.$anonfun$buildReaderWithPartitionValues$1(CometParquetFileFormat.scala:177)
at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.org$apache$spark$sql$execution$datasources$FileScanRDD$$anon$$readCurrentFile(FileScanRDD.scala:217)
at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.nextIterator(FileScanRDD.scala:279)
at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.hasNext(FileScanRDD.scala:129)
at org.apache.spark.sql.comet.CometScanExec$$anon$1.hasNext(CometScanExec.scala:257)
at org.apache.comet.CometBatchIterator.hasNext(CometBatchIterator.java:50)
at org.apache.comet.Native.executePlan(Native Method)
at org.apache.comet.CometExecIterator.$anonfun$getNextBatch$1(CometExecIterator.scala:129)
at org.apache.comet.CometExecIterator.$anonfun$getNextBatch$1$adapted(CometExecIterator.scala:127)
at org.apache.comet.vector.NativeUtil.getNextBatch(NativeUtil.scala:157)
at org.apache.comet.CometExecIterator.getNextBatch(CometExecIterator.scala:127)
at org.apache.comet.CometExecIterator.hasNext(CometExecIterator.scala:148)
at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
at org.apache.comet.CometBatchIterator.hasNext(CometBatchIterator.java:50)
at org.apache.comet.Native.executePlan(Native Method)
at org.apache.comet.CometExecIterator.$anonfun$getNextBatch$1(CometExecIterator.scala:129)
at org.apache.comet.CometExecIterator.$anonfun$getNextBatch$1$adapted(CometExecIterator.scala:127)
at org.apache.comet.vector.NativeUtil.getNextBatch(NativeUtil.scala:157)
at org.apache.comet.CometExecIterator.getNextBatch(CometExecIterator.scala:127)
at org.apache.comet.CometExecIterator.hasNext(CometExecIterator.scala:148)
at org.apache.spark.sql.comet.execution.shuffle.CometShuffleWriteProcessor.write(CometShuffleExchangeExec.scala:512)
at org.apache.spark.sql.comet.shims.ShimCometShuffleWriteProcessor.write(ShimCometShuffleWriteProcessor.scala:35)
at org.apache.spark.sql.comet.shims.ShimCometShuffleWriteProcessor.write$(ShimCometShuffleWriteProcessor.scala:28)
at org.apache.spark.sql.comet.execution.shuffle.CometShuffleWriteProcessor.write(CometShuffleExchangeExec.scala:451)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:104)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:54)
at org.apache.spark.TaskContext.runTaskWithListeners(TaskContext.scala:161)
at org.apache.spark.scheduler.Task.run(Task.scala:141)
at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$4(Executor.scala:620)
at org.apache.spark.util.SparkErrorUtils.tryWithSafeFinally(SparkErrorUtils.scala:64)
at org.apache.spark.util.SparkErrorUtils.tryWithSafeFinally$(SparkErrorUtils.scala:61)
at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:95)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:623)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Steps to reproduce
No response
Expected behavior
No response
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
jinwenjie123 commentedon Mar 27, 2025
I also encountered similar issue when I conducted the test for running spark3.4.4 in AWS. I fixed it by changing to spark3.4.3 since it looks like the issue is caused by shim. Maybe you can try something similar.
mkgada commentedon Mar 28, 2025
@jinwenjie123 appreciate your response! I am using one of the pre-built JARs, I will not be able to switch to Spark 3.4.x since our cluster was recently upgraded to 3.5.x and would like to stick to it
@andygrove @alamb would y'all be able to help here? I saw that the prebuilt JARs were tested for 3.5.4 and upwards. Are they backwards compatible?
alamb commentedon Mar 28, 2025
Sorry I don't know much about comet or java errors
andygrove commentedon Mar 28, 2025
Comet 0.7.0 supported 3.5.0 through 3.5.4 but not 3.5.5 which had breaking changes to internal apis. I am on vacation this week but it looks like 3.5.5 support was added this week.
parthchandra commentedon Mar 29, 2025
This particular API is not a public API and we use it to so we can verify the metrics in tests. Maybe we can disable its use in non test environments?
mkgada commentedon Mar 31, 2025
@andygrove sorry for the confusion here, my cluster is on Spark 3.5.0, and Comet 0.7.0 prebuilt JAR did not work on it
@parthchandra can you elaborate? Is there a opportunity to fix this through config?
parthchandra commentedon Apr 1, 2025
Spark has something like this -
which is then used to enable some configurations by default when in unit tests. We could do the same.
parthchandra commentedon Apr 1, 2025
Also it appears the the API change in TaskMetrics has been backported to 3.4 as well.
mkgada commentedon Apr 1, 2025
Update: spun up another cluster on Spark 3.5.3 and used the same prebuilt Comet JAR 0.7.0
Was able to get past the initial error documented here but now running into
andygrove commentedon Apr 1, 2025
I checked out Spark v3.5.3 and the method is defined as:
It also looks like this method signature has not changed recently.
Can you confirm that you are using the open-source Apache Spark v3.5.3 and not a GCP Dataproc version of Spark?
mkgada commentedon Apr 1, 2025
I am using a Spark image supplied by GCP Dataproc, thank you for checking this
It is this one specifically - https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-release-2.2
v2.2.50-debian12They usually install open source Spark, but I need to confirm this
andygrove commentedon Apr 1, 2025
I am assuming that the GCP version of Spark has some differences in these internal APIs
mkgada commentedon Apr 1, 2025
Thank you so much for looking into this though, @andygrove
I will take this up with GCP folks
mkgada commentedon Apr 4, 2025
Looks like an issue stemming out of Spark, I was able to run my job to success by disabling comet shuffle manager
andygrove commentedon Jun 16, 2025
This issue was likely resolved #693 so will close for now. @mkgada feel free to reopen if this is still an issue