Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2082

org.apache.avro.file.DataFileWriter$AppendWriteException: org.apache.avro.UnresolvedUnionException: Not in union ["double","null"]:

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • spec
    • Avro , Spark , Eclipse

    • error
    • Important

    Description

      Please find below the procedure we followed to create avro file using spark.

      1.Created JSON file for the schema available in table
      2.Created List with JSON file
      3.Created avro StructField by looping the above list using below code
      fields.add(DataTypes.createStructField(field.name().toLowerCase(),getDataTypeForAvro(field.schema()), true));

      Issue:
      If the data type is numeric type(decimal or int) it is not accepting null value
      error message:
      Caused by: org.apache.avro.file.DataFileWriter$AppendWriteException: org.apache.avro.UnresolvedUnionException: Not in union ["double","null"]:

      Attachments

        Activity

          People

            Unassigned Unassigned
            ATUMV002 Atul Gupta
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified