Ahmed Abdul Hamid created GOBBLIN-987:
-----------------------------------------
Summary: JsonRecordAvroSchemaToAvroConverter does not reject
unrecognized Enum symbols
Key: GOBBLIN-987
URL: https://issues.apache.org/jira/browse/GOBBLIN-987
Project: Apache Gobblin
Issue Type: Bug
Reporter: Ahmed Abdul Hamid
Attachments: invalid-enum-unit-test.patch
Here is a failing unit test that demonstrates the issue we encounter when we
attempt to encode the records produced by
{{JsonRecordAvroSchemaToAvroConverter}} with unrecognized Enum symbols:
[^invalid-enum-unit-test.patch]
Here's how to apply the patch and run the test:
{code:bash}
$ git apply invalid-enum-unit-test.patch$
$ ./gradlew :gobblin-core:test --tests *testEnumConversion* {code}
Here's the output:
{code:java}
java.lang.NullPointerException: null of string in field fieldToIgnore of
org.apache.gobblin.test.TestRecord
at
org.apache.avro.generic.GenericDatumWriter.npe(GenericDatumWriter.java:132)
at
org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:126)
at
org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:73)
at
org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:60)
at
org.apache.gobblin.converter.avro.JsonRecordAvroSchemaToAvroConverterTest.testEnumConversion(JsonRecordAvroSchemaToAvroConverterTest.java:82)
{code}
The root cause of the issue that {{JsonRecordAvroSchemaToAvroConverter}} allows
unrecognized Enum symbols not declared in the specified Avro schema.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)