sarutak opened a new pull request, #2468:
URL: https://github.com/apache/avro/pull/2468

   AVRO-3847
   
   ## What is the purpose of the change
   This PR fixes an issue that the current Rust binding doesn't support default 
value of pre-defined name for `Union` type field.
   
   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.
   {code}
   Error: One union type Ref must match the `default`'s value type Map
   {code}
   
   The root cause is the resolution for the type of default value doesn't care 
about known schemas.
   So, the fix is giving such schemas to the resolution.
   
   ## Verifying this change
   Added new tests.
   
   ## Documentation
   
   - Does this pull request introduce a new feature? (no)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@avro.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to