kevinjqliu commented on issue #2511:
URL:
https://github.com/apache/iceberg-python/issues/2511#issuecomment-3326164126
hey @mukul-mpac thanks for reporting this issue. i am not able to reproduce
the issue
heres what i tried
```
from pyiceberg.catalog import load_catalog
from pyiceberg.schema import Schema
from pyiceberg.types import IntegerType, NestedField, StringType, StructType
catalog = load_catalog("default", type="in-memory")
catalog.create_namespace_if_not_exists("default")
schema = Schema(
NestedField(1, "id", StringType(), required=True),
NestedField(2, "name", StringType(), required=False),
NestedField(3, "roll_number", IntegerType(), required=True),
)
table = catalog.create_table(
identifier="default.test",
schema=schema,
)
with table.update_schema() as updater:
updater.add_column(
path="address",
field_type=StructType(
NestedField(4, "street", StringType(), required=False),
NestedField(5, "city", StringType(), required=False),
NestedField(6, "state", StringType(), required=False),
NestedField(7, "zip", IntegerType(), required=False),
),
required=False,
)
table.schema()
```
```
>>> table.schema()
Schema(NestedField(field_id=1, name='id', field_type=StringType(),
required=True), NestedField(field_id=2, name='name', field_type=StringType(),
required=False), NestedField(field_id=3, name='roll_number',
field_type=IntegerType(), required=True), NestedField(field_id=4,
name='address', field_type=StructType(fields=(NestedField(field_id=5,
name='street', field_type=StringType(), required=False),
NestedField(field_id=6, name='city', field_type=StringType(), required=False),
NestedField(field_id=7, name='state', field_type=StringType(), required=False),
NestedField(field_id=8, name='zip', field_type=IntegerType(),
required=False),)), required=False), schema_id=1, identifier_field_ids=[])
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]