[
https://issues.apache.org/jira/browse/NIFI-4441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16207881#comment-16207881
]
ASF GitHub Bot commented on NIFI-4441:
--------------------------------------
Github user mattyb149 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2207#discussion_r145185126
--- Diff:
nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-avro-record-utils/src/test/java/org/apache/nifi/avro/TestAvroTypeUtil.java
---
@@ -239,4 +243,20 @@ public void testComplicatedRecursiveSchema() {
Assert.assertEquals(recordASchema,
((RecordDataType)recordBParentField.get().getDataType()).getChildSchema());
}
+ @Test
+ public void testMapWithNullSchema() throws IOException {
+
+ Schema recursiveSchema = new
Schema.Parser().parse(getClass().getResourceAsStream("schema.json"));
+
+ // Make sure the following doesn't throw an exception
+ RecordSchema recordASchema =
AvroTypeUtil.createSchema(recursiveSchema.getTypes().get(0));
+
+ // check the fix with the proper file
+ try(DataFileStream<GenericRecord> r = new
DataFileStream<>(getClass().getResourceAsStream("data.avro"),
--- End diff --
I have the following schema in my test flow:
`{
"type": "record",
"name": "A","fields": [
{"name": "a", "type": "string"},
{"name": "c", "type": [ "null", {"type" : "map","values" : "string"} ] }
]
}`
When I debug through the processor to AvroTypeUtil, I get a MapRecord as
the type of "value", not Map. If it could be either, we could just check for
either?
> Add MapRecord support inside avro union types
> ---------------------------------------------
>
> Key: NIFI-4441
> URL: https://issues.apache.org/jira/browse/NIFI-4441
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 1.4.0
> Reporter: Patrice Freydiere
>
> Using an avro union type that contain maps in the definition lead to errors
> in loading avro records.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)