kevinjqliu commented on code in PR #590:
URL: https://github.com/apache/iceberg-python/pull/590#discussion_r1561826510


##########
pyiceberg/io/pyarrow.py:
##########
@@ -1772,16 +1772,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(table=arrow_table, 
from_schema=iceberg_table_schema, to_schema=parquet_schema)

Review Comment:
   Currently, we batch the incoming dataframe first (in 
`_dataframe_to_data_files`) and then transform the scheme for each batch. 
   
   We can optimize by transforming first and then batching. 
   
   I want the schema transformation to happen as closely to the parquet writing 
as possible, so going with the first method for now
   



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to