Skip to content
Merged
Prev Previous commit
Next Next commit
parquet writer write once
  • Loading branch information
kevinjqliu committed Mar 9, 2024
commit 9cb96494f1fc77f1d1fe2ca250fd1a7c704a3c84
3 changes: 1 addition & 2 deletions pyiceberg/io/pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1737,8 +1737,7 @@ def write_file(io: FileIO, table_metadata: TableMetadata, tasks: Iterator[WriteT
fo = io.new_output(file_path)
with fo.create(overwrite=True) as fos:
with pq.ParquetWriter(fos, schema=arrow_file_schema, **parquet_writer_kwargs) as writer:
for batch in task.record_batches:
writer.write_batch(batch, row_group_size=row_group_size)
writer.write(pa.Table.from_batches(task.record_batches), row_group_size=row_group_size)

data_file = DataFile(
content=DataFileContent.DATA,
Expand Down