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

Abierto
#19,194 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@adiranjan25 ya está trabajando en esto.

Desde el 30/11/2026.

  • #19205 de @adiranjan25 — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java, spark
Área
databases

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Java
Estrellas
9.5k
Forks
3.7k
Merge medio
2 d 2 h
PR fusionados (30 d)
170

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/iceberg

Todos los issues de apache/iceberg

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.