apache / apache/iceberg-python

`DataScan` `count` method does not respect limit

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

説明

### Apache Iceberg version

0.9.1 (latest release)

### Please describe the bug 🐞

When calling `count()` on a `DataScan`, limit is not respected. Seems trivial but if I set a limit of 5 I expect 5 or less rows back, at least with a scan-like implementation

The underlying `ArrowScan` does not get passed the limit param

https://github.com/apache/iceberg-python/blob/main/pyiceberg/table/__init__.py#L1940

This results in scans taking longer due to not respecting the limit.

The fix will involve more than just passing the limit to the `ArrowScan`

### Willingness to contribute

- [x] I can contribute a fix for this bug independently
- [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [ ] I cannot contribute a fix for this bug at this time

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

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

調査の方向性

pyiceberg/table/__init__.py の 1940 行目付近から始め、基盤となる ArrowScan 呼び出しを通じて DataScan.count を追跡します。limit がどのように伝播されるかを確認し、issue の注記が調整の必要性を示している追加のスキャン動作を特定します。count() が要求された limit を超えて返さず、不要なスキャン処理を避けられれば完了です。

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

評価

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

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

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