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時間
- マージ済み PR(30日)
- 122
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信
-
local devenv exampleオープン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 日以内に返信