resolver
ConstructWriter
¶
Bases: SchemaVisitorPerPrimitiveType[Writer]
Construct a writer tree from an Iceberg schema.
Source code in pyiceberg/avro/resolver.py
EnumReader
¶
Bases: Reader
An Enum reader to wrap primitive values into an Enum.
Source code in pyiceberg/avro/resolver.py
construct_reader(file_schema, read_types=EMPTY_DICT)
¶
Construct a reader from a file schema.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_schema
|
Schema | IcebergType
|
The schema of the Avro file. |
required |
read_types
|
Dict[int, Callable[..., StructProtocol]]
|
Constructors for structs for certain field-ids |
EMPTY_DICT
|
Raises:
Type | Description |
---|---|
NotImplementedError
|
If attempting to resolve an unrecognized object type. |
Source code in pyiceberg/avro/resolver.py
construct_writer(file_schema)
¶
Construct a writer from a file schema.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_schema
|
Schema | IcebergType
|
The schema of the Avro file. |
required |
Raises:
Type | Description |
---|---|
NotImplementedError
|
If attempting to resolve an unrecognized object type. |
Source code in pyiceberg/avro/resolver.py
resolve_reader(file_schema, read_schema, read_types=EMPTY_DICT, read_enums=EMPTY_DICT)
¶
Resolve the file and read schema to produce a reader.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_schema
|
Schema | IcebergType
|
The schema of the Avro file. |
required |
read_schema
|
Schema | IcebergType
|
The requested read schema which is equal, subset or superset of the file schema. |
required |
read_types
|
Dict[int, Callable[..., StructProtocol]]
|
A dict of types to use for struct data. |
EMPTY_DICT
|
read_enums
|
Dict[int, Callable[..., Enum]]
|
A dict of fields that have to be converted to an enum. |
EMPTY_DICT
|
Raises:
Type | Description |
---|---|
NotImplementedError
|
If attempting to resolve an unrecognized object type. |
Source code in pyiceberg/avro/resolver.py
resolve_writer(record_schema, file_schema)
¶
Resolve the file and read schema to produce a reader.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
record_schema
|
Schema | IcebergType
|
The schema of the record in memory. |
required |
file_schema
|
Schema | IcebergType
|
The schema of the file that will be written |
required |
Raises:
Type | Description |
---|---|
NotImplementedError
|
If attempting to resolve an unrecognized object type. |