You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "sarutak (via GitHub)" <gi...@apache.org> on 2023/08/26 17:13:07 UTC

[GitHub] [avro] sarutak opened a new pull request, #2468: AVRO-3847: [Rust] Support default value of pre-defined name for Union type field

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-unsubscribe@avro.apache.org

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


[GitHub] [avro] martin-g commented on pull request #2468: AVRO-3847: [Rust] Support default value of pre-defined name for Union type field

Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g commented on PR #2468:
URL: https://github.com/apache/avro/pull/2468#issuecomment-1700786623

   Thank you, @sarutak !


-- 
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: issues-unsubscribe@avro.apache.org

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


[GitHub] [avro] martin-g merged pull request #2468: AVRO-3847: [Rust] Support default value of pre-defined name for Union type field

Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g merged PR #2468:
URL: https://github.com/apache/avro/pull/2468


-- 
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-unsubscribe@avro.apache.org

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