public class IcebergDecoder<D>
extends org.apache.avro.message.MessageDecoder.BaseDecoder<D>
Constructor and Description |
---|
IcebergDecoder(Schema readSchema)
Creates a new decoder that constructs datum instances described by an
Iceberg schema . |
IcebergDecoder(Schema readSchema,
org.apache.avro.message.SchemaStore resolver)
Creates a new decoder that constructs datum instances described by an
Iceberg schema . |
Modifier and Type | Method and Description |
---|---|
void |
addSchema(Schema writeSchema)
Adds an
Iceberg schema that can be used to decode buffers. |
D |
decode(java.io.InputStream stream,
D reuse) |
public IcebergDecoder(Schema readSchema)
Iceberg 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 using
addSchema(org.apache.iceberg.Schema)
.
readSchema
- the schema used to construct datum instancespublic IcebergDecoder(Schema readSchema, org.apache.avro.message.SchemaStore resolver)
Iceberg 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 using
addSchema(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.
readSchema
- the Schema
used to construct datum instancesresolver
- a SchemaStore
used to find schemas by fingerprintpublic void addSchema(Schema writeSchema)
Iceberg schema
that can be used to decode buffers.writeSchema
- a schema to use when decoding buffers