Package io.trino.hive.formats.avro
Interface AvroTypeManager
- All Known Implementing Classes:
NativeLogicalTypesAvroTypeManager
public interface AvroTypeManager
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when the type manager is reading out data from a data file such as inAvroFileReaderoverrideBlockToAvroObject(org.apache.avro.Schema schema, Type type) Extract and convert the object from the given block at the given position and return the Avro Generic Data forum.overrideBuildingFunctionForSchema(org.apache.avro.Schema schema) Object provided by FasterReader's deserialization with no conversions.overrideTypeForSchema(org.apache.avro.Schema schema)
-
Method Details
-
configure
Called when the type manager is reading out data from a data file such as inAvroFileReader- Parameters:
fileMetadata- metadata from the file header
-
overrideTypeForSchema
- Throws:
AvroTypeException
-
overrideBuildingFunctionForSchema
Optional<BiConsumer<BlockBuilder,Object>> overrideBuildingFunctionForSchema(org.apache.avro.Schema schema) throws AvroTypeException Object provided by FasterReader's deserialization with no conversions. Object class determined by Avro's standard generic data process BlockBuilder provided by Type returned above for the schema Possible to override for each primitive type as well.- Throws:
AvroTypeException
-
overrideBlockToAvroObject
Optional<BiFunction<Block,Integer, overrideBlockToAvroObjectObject>> (org.apache.avro.Schema schema, Type type) throws AvroTypeException Extract and convert the object from the given block at the given position and return the Avro Generic Data forum. Type is either provided explicitly to the writer or derived from the schema using this interface.- Throws:
AvroTypeException
-