Fokko commented on code in PR #5929:
URL: https://github.com/apache/iceberg/pull/5929#discussion_r989722174
##########
python/tests/table/test_partitioning.py:
##########
@@ -102,3 +109,16 @@ def test_deserialize_partition_spec():
PartitionField(source_id=2, field_id=1001,
transform=BucketTransform(num_buckets=25), name="int_bucket"),
),
)
+
+
+def test_partition_type(table_schema_simple: Schema) -> None:
+ spec = PartitionSpec(
+ PartitionField(source_id=1, field_id=1000,
transform=TruncateTransform(width=19), name="str_truncate"),
+ PartitionField(source_id=2, field_id=1001,
transform=BucketTransform(num_buckets=25), name="int_bucket"),
+ spec_id=3,
+ )
+
+ assert spec.partition_type(table_schema_simple) == StructType(
+ NestedField(field_id=1000, name="str_truncate",
field_type=StringType(), required=True),
+ NestedField(field_id=1001, name="int_bucket",
field_type=IntegerType(), required=True),
Review Comment:
Good catch and makes total sense, also added this to the doc 👍🏻
--
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]