ddcprg commented on code in PR #7358: URL: https://github.com/apache/pinot/pull/7358#discussion_r850331077
########## pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java: ########## @@ -107,4 +121,25 @@ protected Object convertRecord(Object value) { } return convertedMap; } + + /** + * This method convert any Avro logical-type converted (or not) value to a class supported by + * Pinot {@link GenericRow} + * + * Note that at the moment BigDecimal is converted to Pinot double which may lead to precision loss or may not be + * represented at all. + * Similarly, timestamp microsecond precision is not supported at the moment. These values will get converted to + * millisecond precision. + */ + @Override + protected Object convertSingleValue(Object value) { + if (value instanceof BigDecimal) { + return ((BigDecimal) value).doubleValue(); + } + if (value instanceof Instant) { Review Comment: I'm thinking it may be better to initially return a String representation of the timestamp instead, Pinot can coerce the value into a timestamp. At this point I can't make a guess of whether the user has specified millis or micros. Behaviour control could be configured via record reader settings in the future. @Jackie-Jiang @walterddr let me know what you think -- 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. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org 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