apache / apache/iceberg-python
ArrowScan materializes entire FileScanTask into memory
- Ngôn ngữ chính
- Python
- Star
- 1.1k
- Fork
- 581
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 78
Mô tả
### 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)
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu trong pyiceberg.io.pyarrow bằng cách lần theo quá trình lặp theo batch của FileScanTask trong ArrowScan và việc xây dựng PyArrow ds.Scanner. Xác nhận rằng các batch được tạo ra mà không materialize toàn bộ iterator ngay từ đầu và rằng batch_size được truyền tới scanner; hoàn thành khi các tệp lớn có thể được xử lý mà không yêu cầu toàn bộ task nằm trong bộ nhớ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- data-engineering, performance
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 65/100