ddcprg commented on code in PR #7358: URL: https://github.com/apache/pinot/pull/7358#discussion_r867687959
########## pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroSchemaUtil.java: ########## @@ -20,18 +20,41 @@ import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.HashMap; +import java.util.Map; +import org.apache.avro.Conversion; +import org.apache.avro.Conversions; +import org.apache.avro.LogicalType; +import org.apache.avro.LogicalTypes; import org.apache.avro.Schema; +import org.apache.avro.data.TimeConversions; import org.apache.pinot.spi.data.FieldSpec; import org.apache.pinot.spi.data.FieldSpec.DataType; import org.apache.pinot.spi.utils.JsonUtils; public class AvroSchemaUtil { + /* + * These constants are copied from org.apache.avro.LogicalTypes + */ + private static final String DECIMAL = "decimal"; + private static final String UUID = "uuid"; + private static final String DATE = "date"; + private static final String TIME_MILLIS = "time-millis"; + private static final String TIME_MICROS = "time-micros"; + private static final String TIMESTAMP_MILLIS = "timestamp-millis"; + private static final String TIMESTAMP_MICROS = "timestamp-micros"; + private static final Map<String, Conversion<?>> CONVERSION_MAP = new HashMap<>(); + private AvroSchemaUtil() { } + public static Conversion<?> findConversionFor(String typeName) { + return CONVERSION_MAP.get(typeName); + } + /** - * Returns the data type stored in Pinot that is associated with the given Avro type. + * Returns the data type stored in Pinot that is associated with the given Avro type. Review Comment: yes, not sure why my IDE is doing this -- 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