Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21847#discussion_r205550953
  
    --- Diff: 
external/avro/src/main/scala/org/apache/spark/sql/avro/AvroSerializer.scala ---
    @@ -165,16 +183,100 @@ class AvroSerializer(rootCatalystType: DataType, 
rootAvroType: Schema, nullable:
           result
       }
     
    -  private def resolveNullableType(avroType: Schema, nullable: Boolean): 
Schema = {
    -    if (nullable) {
    +  private def resolveNullableType(avroType: Schema, catalystType: DataType,
    +                                  nullable: Boolean): Schema = {
    +    if (nullable && avroType.getType == Type.UNION) {
    --- End diff --
    
    Is it possible `nullable == false` but `avroType.getType == Type.UNION`?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to