diff --git a/fastserde/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/SchemaAssistant.java b/fastserde/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/SchemaAssistant.java index 41c1b2e3..cf139c31 100644 --- a/fastserde/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/SchemaAssistant.java +++ b/fastserde/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/SchemaAssistant.java @@ -297,9 +297,12 @@ public JClass classFromSchema(Schema schema, boolean abstractType, boolean rawTy /* Note that settings abstractType and rawType are not passed to subcalls */ public JClass classFromSchema(Schema schema, boolean abstractType, boolean rawType, boolean primitiveList, boolean allowLogicalTypes) { - if (allowLogicalTypes && logicalTypeEnabled(schema)) { + if (logicalTypeEnabled(schema)) { Class logicalTypeClass = ((Conversion) getConversion(schema.getLogicalType())).getConvertedType(); - return codeModel.ref(logicalTypeClass); + fullyQualifiedClassNameSet.add(logicalTypeClass.getName()); + if (allowLogicalTypes) { + return codeModel.ref(logicalTypeClass); + } } JClass outputClass;