table.inspect metadata tables fail (or lose manifest bounds) after dropping an old partition column
維護者通常 1 天內回覆
評估
研究方向
Start with TableMetadata.specs_struct() and _partition_summaries_to_rows(), which call spec.partition_type(...) against the current schema, and with the InspectTable methods that use them. Run the reproduction in the issue to see the ValueError and the 'null' bounds. Done means the inspect partitions/files calls and manifest partition summary bounds work after a source column is dropped. Open PR #4356 already targets this, so check it before starting.
由索引模型根據 Issue 內容生成。
描述
Apache Iceberg version
main (development)
Please describe the bug 🐞
Describe the bug
If a table stops partitioning by a column (update_spec().remove_field(...)) and later drops that source column (update_schema().delete_column(...)):
- Calling
table.inspect.partitions(),entries(),files(),data_files(),delete_files(),all_files(),all_data_files(), orall_delete_files()raisesValueError: Could not find field with id: ...insideTableMetadata.specs_struct(). - Calling
table.inspect.manifests()/all_manifests()succeeds, but renderslower_boundandupper_boundinpartition_summariesas'null'because_partition_summaries_to_rows()evaluatesspec.partition_type(self.tbl.schema()), which falls back toUnknownType().
(Note: open PR #4115 fixes delete() manifest rewrites in pyiceberg/avro/file.py and pyiceberg/manifest.py, whereas this failure occurs in TableMetadata.specs_struct() and InspectTable even without calling delete().)
To Reproduce
import tempfile
import pyarrow as pa
from pyiceberg.catalog.memory import InMemoryCatalog
from pyiceberg.partitioning import PartitionField, PartitionSpec
from pyiceberg.schema import Schema
from pyiceberg.transforms import IdentityTransform
from pyiceberg.types import LongType, NestedField, StringType
with tempfile.TemporaryDirectory() as tmp:
cat = InMemoryCatalog("local", warehouse=f"file://{tmp}/wh")
cat.create_namespace("ns")
tbl = cat.create_table(
"ns.t_v2",
schema=Schema(NestedField(1, "id", LongType()), NestedField(2, "p", StringType())),
partition_spec=PartitionSpec(PartitionField(2, 1000, IdentityTransform(), "p")),
properties={"format-version": "2"},
)
tbl.append(pa.table({"id": [1, 2], "p": ["a", "b"]}))
with tbl.update_spec() as spec_update:
spec_update.remove_field("p")
with tbl.update_schema() as schema_update:
schema_update.delete_column("p")
print(tbl.inspect.manifests().to_pydict()["partition_summaries"])
# [[{'contains_null': False, 'contains_nan': False, 'lower_bound': 'null', 'upper_bound': 'null'}]]
tbl.inspect.partitions()
# ValueError: Could not find field with id: 2
Expected behavior
TableMetadata.specs_struct() and table.inspect.* should resolve partition source field types from historical table schemas when the source column was dropped from the current schema, keeping metadata inspection tables and manifest partition summary bounds readable.
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.files()` and the other file metadata tables raise `ArrowInvalid` when a snapshot has no manifests可能已有人在做 @YuangGao 於 10 天前認領。 未關閉kind:bug
難度 2/5 1-3 小時 新手友好度 72/100
apache/iceberg-python#4269 ·
維護者通常 1 天內回覆
-
`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 天內回覆
查看 apache/iceberg-python 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 80/100
glossyio/traffic-monitor#312 ·
維護者通常 1 天內回覆
-
documentation enhancement
難度 2/5 1-3 小時 新手友好度 76/100
es-ude/elastic-ai.creator#1046 ·
維護者通常 3 天內回覆
-
feature request
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
confident-ai/deepteam#306 ·
維護者通常 1 天內回覆
-
SslLibrary crashes with unhandled OSError: port/proto not found on non-standard SSL ports可能已有人在做 @himanchalkaushale 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
OWASP/Nettacker#1884 · 1 則留言 ·
維護者通常 1 天內回覆