dongjoon-hyun commented on code in PR #37191:
URL: https://github.com/apache/spark/pull/37191#discussion_r924809827
##########
connector/avro/src/test/scala/org/apache/spark/sql/avro/AvroFunctionsSuite.scala:
##########
@@ -238,4 +239,35 @@ class AvroFunctionsSuite extends QueryTest with
SharedSparkSession {
assert(message.contains("Only UNION of a null type and a non-null type
is supported"))
}
}
+
+ test("SPARK-39775: Disable validate default values when parsing Avro
schemas") {
+ val avroTypeStruct = s"""
+ |{
+ | "type": "record",
+ | "name": "struct",
+ | "fields": [
+ | {"name": "id", "type": "long", "default": null}
+ | ]
+ |}
+ """.stripMargin
+ val avroSchema = AvroOptions(Map("avroSchema" ->
avroTypeStruct)).schema.get
+ val sparkSchema =
SchemaConverters.toSqlType(avroSchema).dataType.asInstanceOf[StructType]
+
+ val df = spark.range(5).select('id)
Review Comment:
+1 for @martin-g 's comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]