-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SchemaTranslator: support non-null defaults for primitive and collect…
…ion optional fields (#994)
- Loading branch information
1 parent
59f22de
commit 9237163
Showing
5 changed files
with
92 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
data-avro/src/test/resources/avro/com/linkedin/pegasus/test/NonNullDefaultsTest.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"type": "record", | ||
"name": "Outer", | ||
"namespace": "foo", | ||
"fields": [ | ||
{ | ||
"name": "f1", | ||
"type": { | ||
"type": "record", | ||
"name": "Inner", | ||
"namespace": "bar", | ||
"fields": [ | ||
{ | ||
"name": "innerArray", | ||
"type": { | ||
"type": "array", | ||
"items": "string" | ||
}, | ||
"default": [], | ||
"optional": true | ||
}, | ||
{ | ||
"name": "innerMap", | ||
"type": { | ||
"type": "map", | ||
"values": "string" | ||
}, | ||
"default": {}, | ||
"optional": true | ||
}, | ||
{ | ||
"name": "innerInt", | ||
"type": "int", | ||
"default": 0 | ||
}, | ||
{ | ||
"name": "innerString", | ||
"type": "string", | ||
"default": "defaultValue", | ||
"optional": true | ||
} | ||
] | ||
}, | ||
"default": {}, | ||
"optional": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters