Commit 020c67e
committed
AVRO-4135: [Java] JSON decoding unqualified union types
Support unqualified type references for unions when decoding them from
json.
AVRO-2287 makes it unclear if type reference for a JSON encoded union
needs to be qualified or not.
Today all encoders use the fully qualified types except the C JSON
encoder which uses the unqualified type.
In this patch we make the java JSON Decoder more lenient and let it
fallback to unqualified types names when no qualified type name
matches. Which matches the behavior currently implemented in the
Javascript Json decoder.
This patch is an alternative for apache#3373 where it is proposed
to update the C library instead.1 parent 60796e5 commit 020c67e
2 files changed
Lines changed: 22 additions & 0 deletions
File tree
- lang/java/avro/src
- main/java/org/apache/avro/io/parsing
- test/java/org/apache/avro/io
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
478 | 488 | | |
479 | 489 | | |
480 | 490 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
95 | 107 | | |
0 commit comments