npawar commented on a change in pull request #6046: URL: https://github.com/apache/incubator-pinot/pull/6046#discussion_r502588825
########## File path: pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java ########## @@ -49,13 +51,53 @@ public GenericRow extract(GenericRecord from, GenericRow to) { List<Schema.Field> fields = from.getSchema().getFields(); for (Schema.Field field : fields) { String fieldName = field.name(); - to.putValue(fieldName, AvroUtils.convert(from.get(fieldName))); + Object value = from.get(fieldName); + if (value != null) { + value = convert(value); + } + to.putValue(fieldName, value); } } else { for (String fieldName : _fields) { - to.putValue(fieldName, AvroUtils.convert(from.get(fieldName))); + Object value = from.get(fieldName); + if (value != null) { + value = convert(value); + } + to.putValue(fieldName, value); } } return to; } + + /** + * Returns whether the object is an Avro GenericRecord. + */ + @Override + protected boolean isInstanceOfRecord(Object value) { + return value instanceof GenericRecord; + } + + /** + * Handles the conversion of every field of the Avro GenericRecord. + */ + @Override + @Nullable + protected Object convertRecord(Object value) { Review comment: For this method (and similarly all the ones in BaseRecordExtractor), please add a javadoc for value. Previously we used to cast upfront and the param was directly the type (Collection, GenericRecord etc). But now, we are expecting the right type be provided in value, and casting here without any check. So it would be nice to have a description for the value for all the methods of this nature. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org