syun64 commented on code in PR #603:
URL: https://github.com/apache/iceberg-python/pull/603#discussion_r1564204302
##########
pyiceberg/table/__init__.py:
##########
@@ -3410,6 +3411,94 @@ def _readable_metrics_struct(bound_type: PrimitiveType)
-> pa.StructType:
schema=entries_schema,
)
+ def partitions(self) -> "pa.Table":
+ import pyarrow as pa
+
+ from pyiceberg.io.pyarrow import schema_to_pyarrow
+
+ table_schema = pa.schema([
+ pa.field('record_count', pa.int64(), nullable=False),
+ pa.field('file_count', pa.int32(), nullable=False),
+ pa.field('total_data_file_size_in_bytes', pa.int64(),
nullable=False),
+ pa.field('position_delete_record_count', pa.int64(),
nullable=False),
+ pa.field('position_delete_file_count', pa.int32(), nullable=False),
+ pa.field('equality_delete_record_count', pa.int64(),
nullable=False),
+ pa.field('equality_delete_file_count', pa.int32(), nullable=False),
+ pa.field('last_updated_at', pa.timestamp(unit='ms'),
nullable=True),
+ pa.field('last_updated_snapshot_id', pa.int64(), nullable=True),
+ ])
+
+ partition_record = self.tbl.metadata.specs_struct()
+ has_partitions = len(partition_record.fields) > 0
+
+ if has_partitions:
Review Comment:
Similar to how we did with the entries table, should we opt-in to keep a
consistent table schema for both unpartitioned and partitioned tables?
--
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]