dramaticlly opened a new pull request, #4717: URL: https://github.com/apache/iceberg/pull/4717
2nd step of complete the https://github.com/apache/iceberg/issues/3228 This change include the PartitionSpec but not include its builder part as I want to keep the changelist as small as possible. As suggested in https://github.com/apache/iceberg/issues/4631, the construction of PartitionSpec shall rely on its Builder class with proper checks and such logic shall not be duplicated in its dunder init methods. ```python from iceberg.schema import Schema from iceberg.transforms import bucket from iceberg.types import BooleanType, IntegerType, NestedField, StringType from iceberg.table.partitioning import PartitionSpec, PartitionField table_schema = Schema( NestedField(field_id=1, name="foo", field_type=StringType(), is_optional=False), NestedField(field_id=2, name="bar", field_type=IntegerType(), is_optional=True), NestedField(field_id=3, name="baz", field_type=BooleanType(), is_optional=False), schema_id=1, identifier_field_ids=[1], ) bucket_transform = bucket(IntegerType(), 100) foo_field = PartitionField(source_id=1, field_id=1001, transform=bucket_transform, name="foo_bucket") partition_spec = PartitionSpec(schema=table_schema, spec_id=0, fields=(foo_field,), last_assigned_field_id=1001) >>> partition_spec PartitionSpec: [ 1001: foo_bucket: bucket[100](1) ] ``` I will come up with follow up on PartitionSpecBuilder class CC @samredai @rdblue @dhruv-pratap -- 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]
