Spark: `REPLACE TABLE AS SELECT` under WAP empties `main`

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

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

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

2026年11月30日 から。

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

評価

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

調査の方向性

Start by tracing Spark's REPLACE TABLE AS SELECT handling alongside the WAP branch and WAP ID paths; the issue does not name source files or tests. Reproduce the SQL sequence on Spark 3.5.5, then find the related Spark tests. Done means WAP leaves main as [5] and replaces the audit branch contents with [2], for both branch and ID configurations.

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

説明

bug
Apache Iceberg version

1.12.0 (latest release)

Query engine

Spark

Please describe the bug 🐞

On a table with write.wap.enabled=true, REPLACE TABLE ... AS SELECT with spark.wap.branch set empties main immediately, although WAP must not change main, and appends the result to the WAP branch instead of replacing it. With spark.wap.id, main is emptied too. Reproduced on main (9d4f6c7, 2026-11-28) and 1.12.0, Spark 3.5.5.

Reproduction
CREATE TABLE local.db.t (id INT) USING iceberg TBLPROPERTIES ('write.wap.enabled'='true');
INSERT INTO local.db.t VALUES (5);
ALTER TABLE local.db.t CREATE BRANCH audit;

SET spark.wap.branch=audit;
REPLACE TABLE local.db.t USING iceberg AS SELECT 2 id;
RESET spark.wap.branch;

SELECT 'main', collect_list(id) FROM local.db.t;
SELECT 'audit', collect_list(id) FROM (SELECT id FROM local.db.t.branch_audit ORDER BY id);
Expected
Query Result
main [5]
audit [2]
Actual
Query Result
main []
audit [2,5]
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 を短くまとめたダイジェスト。