Fokko commented on code in PR #590:
URL: https://github.com/apache/iceberg-python/pull/590#discussion_r1564246026
##########
pyiceberg/io/pyarrow.py:
##########
@@ -1780,16 +1781,17 @@ def write_file(io: FileIO, table_metadata:
TableMetadata, tasks: Iterator[WriteT
)
def write_parquet(task: WriteTask) -> DataFile:
+ arrow_table = pa.Table.from_batches(task.record_batches)
+ df = to_requested_schema(requested_schema=parquet_schema,
file_schema=iceberg_table_schema, table=arrow_table)
Review Comment:
Quick check, depending on how long the `from_arrays` take, it doesn't seem
to copy anything:
```
python3.9
Python 3.9.18 (main, Aug 24 2023, 18:16:58)
[Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyarrow as pa
>>> numbers = pa.array(range(100000000))
>>> pa.Table.from_arrays([numbers], names=['abc'])
pyarrow.Table
abc: int64
----
abc: [[0,1,2,3,4,...,99999995,99999996,99999997,99999998,99999999]]
```
--
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]