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

Record field doesn't accept default value if field type is union and the type of default value is pre-defined name

    XMLWordPrintableJSON

Details

    Description

      Given we have a schema like as follows.

      {
          "name": "record1",
          "type": "record",
          "fields": [
              {
                  "name": "f1",
                  "type": {
                      "name": "record2",
                      "type": "record",
                      "fields": [
                          {
                              "name": "f1_1",
                              "type": "int"
                          }
                      ]
                  }
              },  {
                  "name": "f2",
                  "type": ["record2", "int"],
                  "default": {
                      "f1_1": 100
                  }
              }
          ]
      }
      

      The type of the field f2 is union of record2 and int, and the default value is of a value of record2, which is pre-defined.
      Current Rust binding doesn't accept such schemas, raising a error message like as follows.

      Error: One union type Ref must match the `default`'s value type Map
      

      Attachments

        Issue Links

          Activity

            People

              sarutak Kousuke Saruta
              sarutak Kousuke Saruta
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 0.5h
                  0.5h