You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/11/15 17:59:43 UTC
[GitHub] [spark] xkrogen commented on a change in pull request #34009: [SPARK-34378][SQL][AVRO] Enhance AvroSerializer validation to allow extra nullable Avro fields
xkrogen commented on a change in pull request #34009:
URL: https://github.com/apache/spark/pull/34009#discussion_r749561214
##########
File path: external/avro/src/main/scala/org/apache/spark/sql/avro/AvroUtils.scala
##########
@@ -330,4 +332,9 @@ private[sql] object AvroUtils extends Logging {
case Seq() => "top-level record"
case n => s"field '${n.mkString(".")}'"
}
+
+ /** Return true iff `avroField` is nullable, i.e. `UNION` type and has `NULL` as an option. */
Review comment:
Avro represents a nullable field as a union of null and the concrete type, e.g. `union<null, string>` is a nullable string in Avro parlance. A union of null and a single type is equivalent to a nullable field which is not a union, from Spark's perspective. I think `isNullable` is still the correct name; from Spark's perspective, we are checking nullability. The fact that Avro represents this as a union is an implementation detail.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org