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"]:

Add voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: spec
    • Labels:
    • Environment:

      Avro , Spark , Eclipse

    • Tags:
      error
    • Flags:
      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

            • Assignee:
              Unassigned
              Reporter:
              ATUMV002 Atul Gupta

              Dates

              • Created:
                Updated:

                Time Tracking

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

                  Issue deployment