Uploaded image for project: 'Apache Gobblin'
  1. Apache Gobblin
  2. GOBBLIN-1827

Avro Flattener should order nested optional fields correctly if they have a non-null default value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • gobblin-core
    • None

    Description

      • Consider the following description:
      • Record R1 {
      • fields : {[
      • {
      • Union : [
      • null,
      • Record R2 {
      • fields : {[
      • { * String S1 *. default: String S3 * }

        , {

      • String S2
      • }
      • ]}
      • }
      • }
      • ]}
      • }
      • will be flattened to:
      • Record R1 {
      • fields : {[
      • { * Union : [ null, String S1] *. default: String S3 * }

        , {

      • Union : [ null, String S2]
      • }
      • ]}
      • }
        Due to the addition of the AvroCompatibilityHelper, Avro flattening can run into an issue in the above scenario due to the nested non-null default S3 since the default type needs to be the first type in the field order. So R1 should have field S1 as Union [String S1, null]

      Attachments

        Activity

          People

            abti Abhishek Tiwari
            wlo William Lo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

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