Skip to content

Conversation

@wangyum
Copy link
Member

@wangyum wangyum commented Aug 1, 2025

What is the purpose of the change

Enhanced the error message when an invalid sync marker is encountered in DataFileStream. The new message provides more context about what a sync marker is, why it might be invalid, and suggests possible solutions to fix the problem.

The previous error message was too brief ("Invalid sync!") and didn't provide users with enough information to understand or troubleshoot the issue. The improved message makes debugging easier by explaining:

  • What exactly failed (sync marker mismatch)
  • Likely causes (data corruption, truncation, incorrect concatenation)
  • Steps to resolve the issue

@github-actions github-actions bot added the Java Pull Requests for Java binding label Aug 1, 2025
@wangyum wangyum force-pushed the AVRO-4170 branch 2 times, most recently from d74c13b to 5de891e Compare August 1, 2025 03:48
@wangyum
Copy link
Member Author

wangyum commented Aug 1, 2025

Current error message:

25/07/29 01:07:53 INFO Executor: Executor killed task 178.0 in stage 1.0 (TID 535), reason: Stage cancelled: Job aborted due to stage failure: Task 52 in stage 1.0 failed 4 times, most recent failure: Lost task 52.3 in stage 1.0 (TID 1232) (my.executor.host.com executor 74): org.apache.avro.AvroRuntimeException: java.io.IOException: Invalid sync!
	at org.apache.avro.file.DataFileStream.hasNext(DataFileStream.java:236)
	at org.apache.hadoop.hive.ql.io.avro.AvroGenericRecordReader.next(AvroGenericRecordReader.java:160)
	at org.apache.hadoop.hive.ql.io.avro.AvroGenericRecordReader.next(AvroGenericRecordReader.java:54)
	at org.apache.spark.rdd.HadoopRDD$$anon$1.getNext(HadoopRDD.scala:324)
	at org.apache.spark.rdd.HadoopRDD$$anon$1.getNext(HadoopRDD.scala:246)
	at org.apache.spark.util.NextIterator.hasNext(NextIterator.scala:73)
	at org.apache.spark.InterruptibleIterator.hasNext(InterruptibleIterator.scala:37)
	at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
	at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
	at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
	at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.hashAgg_doAggregateWithKeys_0$(Unknown Source)
	at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage2.processNext(Unknown Source)
	at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:51)
	at org.apache.spark.sql.execution.WholeStageCodegenEvaluatorFactory$WholeStageCodegenPartitionEvaluator$$anon$1.hasNext(WholeStageCodegenEvaluatorFactory.scala:43)
	at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:460)
	at org.apache.spark.shuffle.sort.BypassMergeSortShuffleWriter.write(BypassMergeSortShuffleWriter.java:140)
	at org.apache.spark.shuffle.ShuffleWriteProcessor.write(ShuffleWriteProcessor.scala:59)
	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:147)
	at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$4(Executor.scala:622)
	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:94)

@wangyum
Copy link
Member Author

wangyum commented Aug 1, 2025

cc @martin-g @opwvhk @zcsizmadia

@wangyum wangyum changed the title AVRO-4170: Improve sync marker error message in DataFileStream AVRO-4170: [Java] Improve sync marker error message in DataFileStream Aug 1, 2025
@martin-g
Copy link
Member

martin-g commented Aug 1, 2025

I've made the same improvement to the Rust SDK - apache/avro-rs#249

@opwvhk opwvhk merged commit 6db1f79 into apache:main Sep 11, 2025
9 checks passed
@wangyum wangyum deleted the AVRO-4170 branch September 11, 2025 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java Pull Requests for Java binding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants