[ 
https://issues.apache.org/jira/browse/AVRO-3847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17760856#comment-17760856
 ] 

ASF subversion and git services commented on AVRO-3847:
-------------------------------------------------------

Commit 0f27d444f93d0a10e4e02084973654b9dae406a0 in avro's branch 
refs/heads/branch-1.11 from Kousuke Saruta
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=0f27d444f ]

AVRO-3847: [Rust] Support default value of pre-defined name for Union type 
field (#2468)

(cherry picked from commit b9cbf9a090000d6a30ffb3b956aee9195b9d8047)


> Record field doesn't accept default value if field type is union and the type 
> of default value is pre-defined name
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: AVRO-3847
>                 URL: https://issues.apache.org/jira/browse/AVRO-3847
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: rust
>    Affects Versions: 1.12.0
>            Reporter: Kousuke Saruta
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Given we have a schema like as follows.
> {code}
> {
>     "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
>             }
>         }
>     ]
> }
> {code}
> 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}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to