-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Populate methods now always have 'customization' argument because
deserialize-method(s) of nested records may generate another populate methods that require 'customization' (at least for compilation). TDD approach - this commit adds unit test which fails and shows where the issue actually is.
- Loading branch information
1 parent
9321e76
commit 96cd780
Showing
4 changed files
with
121 additions
and
5 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
fastserde/avro-fastserde-tests-common/src/test/avro/recordWith2Fields.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,17 @@ | ||
{ | ||
"type": "record", | ||
"name": "RecordWithOneNullableText", | ||
"namespace": "com.linkedin.avro.fastserde.generated.avro", | ||
"doc": "Used in tests of fast-serde to verify populate-methods works correctly with DatumReaderCustomization.", | ||
"fields": [ | ||
{ | ||
"name": "text", | ||
"type": [ | ||
"null", | ||
"string" | ||
], | ||
"default": null, | ||
"doc": "Corresponds with recordWith2FieldsAndDeeplyNestedRecord.avsc" | ||
} | ||
] | ||
} |
59 changes: 59 additions & 0 deletions
59
...rde/avro-fastserde-tests-common/src/test/avro/recordWith2FieldsAndDeeplyNestedRecord.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,59 @@ | ||
{ | ||
"type": "record", | ||
"name": "RecordWithOneNullableTextAndDeeplyNestedRecord", | ||
"namespace": "com.linkedin.avro.fastserde.generated.avro", | ||
"doc": "Used in tests of fast-serde to verify populate-methods works correctly with DatumReaderCustomization. Just like OuterRecordWith2NestedBetaRecords but with one field more.", | ||
"fields": [ | ||
{ | ||
"name": "text", | ||
"type": [ | ||
"null", | ||
"string" | ||
], | ||
"default": null, | ||
"doc": "Corresponds with recordWith2Fields.avsc" | ||
}, | ||
{ | ||
"name": "nestedField", | ||
"type": [ | ||
"null", | ||
{ | ||
"name": "NestedRecord", | ||
"type": "record", | ||
"fields": [ | ||
{ | ||
"name": "sampleText1", | ||
"type": [ | ||
"null", | ||
"string" | ||
], | ||
"default": null, | ||
"doc": "field just to make crowd and force FastDeserializerGenerator to create populate*() method" | ||
}, | ||
{ | ||
"name": "deeplyNestedField", | ||
"type": [ | ||
"null", | ||
{ | ||
"name": "DeeplyNestedRecord", | ||
"type": "record", | ||
"fields": [ | ||
{ | ||
"name": "deeplyDeeplyNestedText", | ||
"type": [ | ||
"null", | ||
"string" | ||
], | ||
"default": null | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"default": null | ||
} | ||
] | ||
} |
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