Skip to content

Commit 68c24f6

Browse files
Use previous versions behaviour as default for new constructor parameter (#353)
1 parent fda9b4f commit 68c24f6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/scala/org/apache/spark/sql/avro/AbrisAvroDeserializer.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ class AbrisAvroDeserializer(rootAvroType: Schema, rootCatalystType: DataType) {
3636
.newInstance(rootAvroType, rootCatalystType) // Spark 2.4 -
3737
}.recover { case _: NoSuchMethodException =>
3838
clazz.getConstructor(classOf[Schema], classOf[DataType], classOf[String])
39-
.newInstance(rootAvroType, rootCatalystType, "LEGACY") // Spark 3.0 +
39+
.newInstance(rootAvroType, rootCatalystType, "LEGACY") // Spark 3.0 - Spark 3.5.0 (including)
40+
}.recover { case _: NoSuchMethodException =>
41+
clazz.getConstructor(classOf[Schema], classOf[DataType], classOf[String], classOf[Boolean])
42+
.newInstance(rootAvroType, rootCatalystType, "LEGACY", false: java.lang.Boolean) // Spark 3.5.x +
4043
}
4144
.get
4245
.asInstanceOf[AvroDeserializer]

0 commit comments

Comments
 (0)