Package io.trino.hive.formats.avro
Interface AvroTypeBlockHandler
- All Known Implementing Classes:
HiveAvroTypeBlockHandler,NativeLogicalTypesAvroTypeBlockHandler
public interface AvroTypeBlockHandler
-
Method Summary
Modifier and TypeMethodDescriptionblockBuildingDecoderFor(AvroReadAction readAction) voidCalled when the type manager is reading out data from a data file such as inAvroFileReaderThis usage implies interior immutability of the block handler.typeFor(org.apache.avro.Schema schema) Returns the block type to build for this Avro schema.
-
Method Details
-
configure
Called when the type manager is reading out data from a data file such as inAvroFileReaderThis usage implies interior immutability of the block handler. The avro library (and our usage of it) requires the block handler to be defined when opening up a file. However, Hive uses the metadata from the file to define behavior of the block handler. Instead of writing our own version of the Avro file reader, interior mutability is allowed. This will be called once before any data of the file is read, but after the Trino types are defined for the read schema. It will be called once per file.- Parameters:
fileMetadata- metadata from the file header
-
typeFor
Returns the block type to build for this Avro schema.- Throws:
AvroTypeException- in case there is no Type for or misconfiguration with the given schema
-
blockBuildingDecoderFor
- Throws:
AvroTypeException
-