Flink: Streaming from a missing branch can plan main's files and fail with a misleading error
Maintainers usually reply within 1 day
@jiwen624 is already working on this.
Since Nov 29, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- java
- Domain
- backend, data-engineering
Research direction
The issue identifies IcebergSource and the automatic starting strategies, but does not name source files or tests. Start by tracing how the source initializes a streaming position and discovers snapshots for a branch, then inspect tests for the listed strategies. Done means the chosen missing-branch behavior is explicit and avoids misleading planning failures or skipped files; the issue leaves that behavior undecided.
Written by the indexing model from the issue text.
Description
Apache Iceberg version
None
Query engine
None
Please describe the bug 🐞
When IcebergSource streams from a branch that doesn't exist, the automatic starting strategies initialize the position from main, but later discovery looks up the branch and finds no snapshot. If the saved position is non-null, planning throws Invalid last enumerated position for an empty table: not null, which doesn't mention the branch, and the job fails once max-allowed-planning-failures (default 3) is exceeded.
TABLE_SCAN_THEN_INCREMENTAL: plans main's files, so rows from main may be emitted before the failure.INCREMENTAL_FROM_LATEST_SNAPSHOT_EXCLUSIVE: fails whenever main has a current snapshot.INCREMENTAL_FROM_LATEST_SNAPSHOT,INCREMENTAL_FROM_EARLIEST_SNAPSHOT: fail if the chosen start snapshot has a parent ID (e.g. main has 2+ snapshots, or older snapshots were expired). Otherwise they wait.
When the table has no current snapshot, these strategies wait and read the branch once it's created, so failing fast would change existing behavior. Simply treating a missing branch as empty doesn't work either: TABLE_SCAN_THEN_INCREMENTAL then skips its initial scan once the branch appears and misses still-live files from expired snapshots. Waiting would need the source to stay uninitialized until the branch exists.
Should a missing branch fail, or wait for the branch to be created? A clearer error naming the branch would help either way. Found while working on #19099, which keeps this behavior unchanged.
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