apache / apache/iceberg-python

ArrowScan materializes entire FileScanTask into memory

クローズ
#3,036 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
stale
主要言語
Python
スター
1.1k
フォーク
581
平均マージ
1日 17時間
マージ済み PR(30日)
77

説明

### Feature Request / Improvement

ArrowScan in PyIceberg does not support true streaming, leading to OOM failures when processing large files (file size > container size). While the API returns an iterator, the implementation eagerly materializes all record batches for a FileScanTask before yielding the first row.

Two primary bottlenecks were identified in the `pyiceberg.io.pyarrow` implementation:
1. The internal scan logic uses a `list()` constructor on the batch iterator, forcing the entire file into memory.
2. The `batch_size` parameter is not forwarded to the underlying PyArrow ds.Scanner, preventing granular memory control. Though, it does fallback to the standard

This behavior makes it impossible to process files larger than the available memory in distributed environments (e.g., Ray workers)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

pyiceberg.io.pyarrow から始め、ArrowScan の FileScanTask のバッチ反復処理と PyArrow ds.Scanner の構築を追跡します。イテレータを先に完全にマテリアライズせずにバッチが生成されること、および batch_size が scanner に到達することを確認します。大きなファイルをタスク全体をメモリに保持することなく処理できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
data-engineering, performance
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
65/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。