Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-11114

[Java] Metadata serialization is broken for Field class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 3.0.0
    • Java

    Description

      org.apache.arrow.vector.types.pojo.Field uses asymmetric serialization and deserialization for the metadata field, causing it to fail to deserialize with the following error:

      Exception in thread "main" com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.util.ArrayList` out of START_OBJECT tokenException in thread "main" com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.util.ArrayList` out of START_OBJECT token at [Source: (File); line: 10, column: 20] (through reference chain: org.apache.arrow.vector.types.pojo.Schema["fields"]->java.util.ArrayList[0]->org.apache.arrow.vector.types.pojo.Field["metadata"]) 

      This is because the class serializes metadata as Map<String, String> but expects to deserialize it as List<Map<String, String>>

      MCVE: https://gist.github.com/nbruno/983cb7faf41dc20a0810ae80fe33562d

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nickb611 Nick Bruno
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m