`inspect.files()` and the other file metadata tables raise `ArrowInvalid` when a snapshot has no manifests
維護者通常 1 天內回覆
評估
研究方向
從 pyiceberg/table/inspect.py 開始:_files 以 pa.concat_tables(results) 結尾,_all_files 也是如此,因此當清單列表為空時兩者都會失敗。執行重現腳本,它會向 SqlCatalog 表追加一個空的 Arrow 表,然後呼叫 inspect.files()。當 files()、data_files()、delete_files() 以及 all_* 系列變體回傳具有 files 結構的空表,而不是拋出 ArrowInvalid 時即完成,包括在用空表執行 overwrite 之後。
由索引模型根據 Issue 內容生成。
描述
Apache Iceberg version
0.12.0 (latest release)
Please describe the bug 🐞
Appending an empty Arrow table creates a snapshot whose manifest list has no manifests. After that, inspect.files(), data_files(), delete_files(), all_files(), all_data_files(), and all_delete_files() all raise ArrowInvalid: Must pass at least one table. I expected each of them to return an empty table with the files schema.
import tempfile
import pyarrow as pa
from pyiceberg.catalog.sql import SqlCatalog
warehouse = tempfile.mkdtemp()
catalog = SqlCatalog("t", uri=f"sqlite:///{warehouse}/catalog.db", warehouse=f"file://{warehouse}")
catalog.create_namespace("n")
df = pa.table({"x": pa.array([], pa.int64())})
table = catalog.create_table("n.t", schema=df.schema)
table.append(df)
table.inspect.files() # ArrowInvalid: Must pass at least one table
Traceback (most recent call last):
File "repro.py", line 12, in <module>
table.inspect.files() # ArrowInvalid: Must pass at least one table
^^^^^^^^^^^^^^^^^^^^^
File "pyiceberg/table/inspect.py", line 900, in files
return self._files(snapshot_id)
^^^^^^^^^^^^^^^^^^^^^^^^
File "pyiceberg/table/inspect.py", line 888, in _files
return pa.concat_tables(results)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "pyarrow/table.pxi", line 6344, in pyarrow.lib.concat_tables
File "pyarrow/error.pxi", line 155, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 92, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Must pass at least one table
overwrite() with an empty table after a non-empty append also leaves a snapshot with no manifests, and files() fails the same way.
_files reads one table per manifest and ends with pa.concat_tables(results), so an empty manifest list calls pa.concat_tables([]). _all_files does the same at L981. Both already return an empty table one level up: _files when the table has no current snapshot (L876-L877), and _all_files when the table has no snapshots (L968-L970). Could they return the same empty table when there are no manifests?
This reproduces on 0.12.0 and on main at e3564a54c10960307147377c578680276865ed18.
Willingness to contribute
- 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
- 主要語言
- Python
- 星號
- 1.2k
- 分支
- 654
- 平均合併
- 2 天 11 小時
- 30 天內合併 PR
- 122
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/iceberg-python 的其他 Issue
-
`inspect.entries()` raises TypeError when a data file has no column_sizes可能已有人在做 @Rahul-cs50 於 14 天前認領。 未關閉kind:bug
難度 2/5 1-3 小時 新手友好度 78/100
apache/iceberg-python#4186 · 2 則留言 ·
維護者通常 1 天內回覆
-
`older_than` reads a naive datetime as UTC and expires snapshots it should keep可能已有人在做 @Rahul-cs50 於 13 天前認領。 未關閉kind:bug
難度 2/5 1-3 小時 新手友好度 72/100
apache/iceberg-python#4182 · 1 則留言 ·
維護者通常 1 天內回覆
-
REST: Send empty first-page pageToken when rest-page-size is set可能已有人在做 @ehddnr301 於 32 天前認領。 未關閉kind:bug
難度 2/5 1-3 小時 新手友好度 82/100
apache/iceberg-python#4096 ·
維護者通常 1 天內回覆
-
PyArrowFileIO: every small S3 write is a 3-request multipart upload; expose allow_delayed_open可能已有人在做 @David-Banquet 於 29 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 70/100
apache/iceberg-python#4093 · 3 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
apache/iceberg-python#4010 · 4 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
查看 apache/iceberg-python 的全部 Issue
相似的 Issue
-
Unknown stop ID in slow zone data crashes post formatting and skips the rest of that day's posts未關閉backend bug tm-new-volunteer
難度 2/5 1-3 小時 新手友好度 84/100
transitmatters/mbta-slow-zone-bot#81 · 1 則留言 ·
-
area:schema documentation
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
risk:high type:ci
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 64/100
spacetelescope/rdmt-spire#49 ·
維護者通常 1 天內回覆