Class AvroRecordExtractor
- java.lang.Object
-
- org.apache.pinot.spi.data.readers.BaseRecordExtractor<org.apache.avro.generic.GenericRecord>
-
- org.apache.pinot.plugin.inputformat.avro.AvroRecordExtractor
-
- All Implemented Interfaces:
Serializable,RecordExtractor<org.apache.avro.generic.GenericRecord>
public class AvroRecordExtractor extends BaseRecordExtractor<org.apache.avro.generic.GenericRecord>
Extractor for Avro Records- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AvroRecordExtractor()
-
Method Summary
Modifier and Type Method Description protected ObjectconvertRecord(Object value)Handles the conversion of every field of the Avro GenericRecord.protected ObjectconvertSingleValue(Object value)This method convert any Avro logical-type converted (or not) value to a class supported by PinotGenericRowNote that at the moment BigDecimal is converted to Pinot double which may lead to precision loss or may not be represented at all.GenericRowextract(org.apache.avro.generic.GenericRecord from, GenericRow to)voidinit(Set<String> fields, RecordExtractorConfig recordExtractorConfig)protected booleanisRecord(Object value)Returns whether the object is an Avro GenericRecord.-
Methods inherited from class org.apache.pinot.spi.data.readers.BaseRecordExtractor
convert, convertMap, convertMultiValue, isMap, isMultiValue
-
-
-
-
Method Detail
-
init
public void init(@Nullable Set<String> fields, @Nullable RecordExtractorConfig recordExtractorConfig)
-
extract
public GenericRow extract(org.apache.avro.generic.GenericRecord from, GenericRow to)
-
isRecord
protected boolean isRecord(Object value)
Returns whether the object is an Avro GenericRecord.- Overrides:
isRecordin classBaseRecordExtractor<org.apache.avro.generic.GenericRecord>
-
convertRecord
@Nullable protected Object convertRecord(Object value)
Handles the conversion of every field of the Avro GenericRecord.- Overrides:
convertRecordin classBaseRecordExtractor<org.apache.avro.generic.GenericRecord>- Parameters:
value- should be verified to be a GenericRecord type prior to calling this method as it will be casted without checking
-
convertSingleValue
protected Object convertSingleValue(Object value)
This method convert any Avro logical-type converted (or not) value to a class supported by PinotGenericRowNote 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.- Overrides:
convertSingleValuein classBaseRecordExtractor<org.apache.avro.generic.GenericRecord>
-
-