procedures called on `db.t.branch_b` act on `main`
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java, spark
- Domain
- backend-api-design, databases
Research direction
Start by tracing how Spark procedures resolve the table argument and select a branch or snapshot; the report names add_files, set_current_snapshot, rewrite_manifests, compute_table_stats, and rewrite_data_files as comparison points. Reproduce the SQL example against Iceberg 1.12.0 or the reported main revision and inspect the procedure tests. Done when procedures consistently commit to the requested branch and the regression is covered by tests.
Written by the indexing model from the issue text.
Description
Apache Iceberg version
1.12.0 (latest release)
Query engine
Spark
Please describe the bug 🐞
CALL add_files(table => 'db.t.branch_b', ...) succeeds but commits the files to main, not to branch b. Other procedures ignore the branch the same way, e.g. set_current_snapshot, rewrite_manifests and compute_table_stats; only rewrite_data_files honors it. 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;
INSERT INTO local.db.t VALUES (1);
ALTER TABLE local.db.t CREATE BRANCH b;
-- control: INSERT honors the branch
INSERT INTO local.db.t.branch_b VALUES (2);
CREATE TABLE src (id INT) USING parquet LOCATION '/tmp/src';
INSERT INTO src VALUES (100);
CALL local.system.add_files(table => 'db.t.branch_b', source_table => '`parquet`.`/tmp/src`');
SELECT 'main', collect_list(id) FROM (SELECT id FROM local.db.t ORDER BY id);
SELECT 'b', collect_list(id) FROM (SELECT id FROM local.db.t.branch_b ORDER BY id);
Expected
| Query | Result |
|---|---|
main |
[1] |
b |
[1,2,100] |
Actual
| Query | Result |
|---|---|
main |
[1,100] |
b |
[1,2] |
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
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 3.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 170
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/iceberg
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Spark: Test INSERT targets with computed IDENTIFIER expressionsPossibly taken @shivadarshan-devadiga claimed this 15 days ago. Openimprovement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
[Core] TestAvroPartitionStatsHandler fails on Windows due to unclosed partition statistics scanPossibly taken @Ankitkj1999 claimed this 17 days ago. Open
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Core: TableMetadata.Builder allows adding encryption keys to v1/v2 tablesPossibly taken @yusufyildiz34 claimed this 37 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/iceberg#18632 · 1 comment ·
Maintainers usually reply within 1 day
-
Kafka: Filter empty strings and whitespace in IcebergSinkConfig stringToListPossibly taken @mohamed-elbrik claimed this 42 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
HexaHexes/neoforge-mod-template#124 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenLiberty/open-liberty#36410 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
erkamyaman/rust-anything#1153 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Card-Forge/forge#13173 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day