Details
-
Bug
-
Status: Done
-
Minor
-
Resolution: Fixed
-
None
-
None
-
All
-
Small
Description
I have an avro record with a field of type array of array (please see attached avro file).
When i try to convert it to TCK record with AvroToRecord class, i get the following exception
AvroRuntimeException: Not a record
After investigation, i found the code which leads to this exception:
case ARRAY: builder.withType(Type.ARRAY); extractedSchema = AvroHelper.getUnionSchema(AvroHelper.getUnionSchema(field.schema()).getElementType()); Type toType = translateToRecordType((extractedSchema.getType())); subBuilder = recordBuilderFactory.newSchemaBuilder(toType); switch (toType) { case RECORD: case ARRAY: extractedSchema.getFields().stream().map(this::inferAvroField).forEach(subBuilder::withEntry); builder.withElementSchema(subBuilder.build()); break;
Here we call extractedSchema.getFields() while the extracted schema is an array.
Attachments
Issue Links
- depends on
-
TCOMP-1957 Avro schema builder issue
-
- Done
-
-
TDI-46440 TCK schema is not complete when generated with AvroToRecord tool
-
- Done
-
- is child of
-
TCOMP-1987 Avro record : Array of Array of records issue
-
- Done
-