Package io.trino.hive.formats.avro
Class HiveAvroTypeBlockHandler
java.lang.Object
io.trino.hive.formats.avro.HiveAvroTypeBlockHandler
- All Implemented Interfaces:
AvroTypeBlockHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
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.
-
Constructor Details
-
HiveAvroTypeBlockHandler
-
-
Method Details
-
configure
Description copied from interface:AvroTypeBlockHandlerCalled 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.- Specified by:
configurein interfaceAvroTypeBlockHandler- Parameters:
fileMetadata- metadata from the file header
-
typeFor
Description copied from interface:AvroTypeBlockHandlerReturns the block type to build for this Avro schema.- Specified by:
typeForin interfaceAvroTypeBlockHandler- Throws:
AvroTypeException- in case there is no Type for or misconfiguration with the given schema
-
blockBuildingDecoderFor
public BlockBuildingDecoder blockBuildingDecoderFor(AvroReadAction readAction) throws AvroTypeException - Specified by:
blockBuildingDecoderForin interfaceAvroTypeBlockHandler- Throws:
AvroTypeException
-