`partitions` metadata table merges NULL partitions from different specs

オープン
#19,140 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@adiranjan25 がすでに取り組んでいます。

2026年11月25日 から。

  • #19148 @adiranjan25 による — オープン

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
18/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java, spark
領域
data

調査の方向性

Start by running the reproduction script in the issue against a local Spark session to confirm that the partitions table merges the NULL-valued rows across specs 0 and 2 while the control table does not. Pull request 19148 is already open against this bug, so read it and its review before writing anything. Done means the NULL-partition case yields one row per spec_id, matching the control table and the files table.

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

説明

bug
Apache Iceberg version

main (development)

Query engine

Spark

Please describe the bug 🐞

After DROP PARTITION FIELD p and ADD PARTITION FIELD q, a file with p = NULL (old spec) and a file with q = NULL (new spec) are reported by the partitions table as one row with the new spec_id and summed counts; spec 0 disappears. With non-NULL values there is one row per spec. Reproduced on main (2e12b22, 2026-11-25) and 1.12.0, Spark 3.5.5.

Reproduction
CREATE TABLE local.t (id INT, p STRING, q STRING) USING iceberg PARTITIONED BY (p);
INSERT INTO local.t VALUES (1, NULL, 'old');
ALTER TABLE local.t DROP PARTITION FIELD p;
ALTER TABLE local.t ADD PARTITION FIELD q;
INSERT INTO local.t VALUES (2, 'new', NULL);
SELECT 'parts' AS marker, spec_id, partition, record_count, file_count FROM local.t.partitions ORDER BY spec_id;
SELECT 'files' AS marker, spec_id, partition FROM local.t.files ORDER BY spec_id;

-- control: non-NULL values
CREATE TABLE local.c (id INT, p STRING, q STRING) USING iceberg PARTITIONED BY (p);
INSERT INTO local.c VALUES (1, 'old', 'old');
ALTER TABLE local.c DROP PARTITION FIELD p;
ALTER TABLE local.c ADD PARTITION FIELD q;
INSERT INTO local.c VALUES (2, 'new', 'new');
SELECT 'control' AS marker, spec_id, partition, record_count, file_count FROM local.c.partitions ORDER BY spec_id;
Expected vs. actual
Expected Actual
local.t.partitions 0 {"p":null,"q":null} 1 1
2 {"p":null,"q":null} 1 1
2 {"p":null,"q":null} 2 2
local.t.files 0 ..., 2 ... 0 {"p":null,"q":null}
2 {"p":null,"q":null}
local.c.partitions (control) one row per spec 0 {"p":"old","q":null} 1 1
2 {"p":null,"q":"new"} 1 1

The old-spec partition (p is NULL) and the new-spec partition (q is NULL) are different partitions, but they are collapsed into one row and the old spec_id 0 disappears.

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
主要言語
Java
スター
9.5k
フォーク
3.7k
平均マージ
2日 2時間
マージ済み PR(30日)
170

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/iceberg のほかの issue

apache/iceberg の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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