Class IcebergDecoder<D>
- java.lang.Object
-
- org.apache.avro.message.MessageDecoder.BaseDecoder<D>
-
- org.apache.iceberg.data.avro.IcebergDecoder<D>
-
- All Implemented Interfaces:
org.apache.avro.message.MessageDecoder<D>
public class IcebergDecoder<D> extends org.apache.avro.message.MessageDecoder.BaseDecoder<D>
-
-
Constructor Summary
Constructors Constructor Description IcebergDecoder(Schema readSchema)
Creates a new decoder that constructs datum instances described by anIceberg schema
.IcebergDecoder(Schema readSchema, org.apache.avro.message.SchemaStore resolver)
Creates a new decoder that constructs datum instances described by anIceberg schema
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSchema(Schema writeSchema)
Adds anIceberg schema
that can be used to decode buffers.D
decode(java.io.InputStream stream, D reuse)
-
-
-
Constructor Detail
-
IcebergDecoder
public IcebergDecoder(Schema readSchema)
Creates a new decoder that constructs datum instances described by anIceberg schema
.The
readSchema
is as used the expected schema (read schema). Datum instances created by this class will are described by the expected schema.The schema used to decode incoming buffers is determined by the schema fingerprint encoded in the message header. This class can decode messages that were encoded using the
readSchema
and other schemas that are added usingaddSchema(org.apache.iceberg.Schema)
.- Parameters:
readSchema
- the schema used to construct datum instances
-
IcebergDecoder
public IcebergDecoder(Schema readSchema, org.apache.avro.message.SchemaStore resolver)
Creates a new decoder that constructs datum instances described by anIceberg schema
.The
readSchema
is as used the expected schema (read schema). Datum instances created by this class will are described by the expected schema.The schema used to decode incoming buffers is determined by the schema fingerprint encoded in the message header. This class can decode messages that were encoded using the
readSchema
and other schemas that are added usingaddSchema(org.apache.iceberg.Schema)
.Schemas may also be returned from an Avro
SchemaStore
. Avro Schemas from the store must be compatible with Iceberg and should contain id properties and use only Iceberg types.- Parameters:
readSchema
- theSchema
used to construct datum instancesresolver
- aSchemaStore
used to find schemas by fingerprint
-
-
Method Detail
-
addSchema
public void addSchema(Schema writeSchema)
Adds anIceberg schema
that can be used to decode buffers.- Parameters:
writeSchema
- a schema to use when decoding buffers
-
-