You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "thswlsqls (via GitHub)" <gi...@apache.org> on 2026/08/01 01:58:58 UTC

[PR] Flink: Backport fix NPE in ExpireSnapshots config when retain-last is unset to 2.0 and 1.20 [iceberg]

thswlsqls opened a new pull request, #17458:
URL: https://github.com/apache/iceberg/pull/17458

   ## Summary
   
   - Backport of #17277 to the Flink 2.0 and 1.20 modules, requested by @pvary on that PR.
   - `ExpireSnapshots.Builder.config()` passed `ExpireSnapshotsConfig.retainLast()` straight into `retainLast(int)`. That getter returns `null` when the `retain-last` option is unset, so unboxing it threw `NullPointerException` and `config()` was unusable for anyone who left the option out.
   - `config()` now calls `retainLast()` and `maxSnapshotAge()` only when the config holds a value, keeping the builder defaults otherwise, and drops the then-unused `java.util.Optional` import.
   - Same diff as d07a574742173bbc43ae2d84d4e7875c4245ebfd on 2.1; the surrounding code was identical, so it applied without adaptation. `ExpireSnapshots.java` and `TestExpireSnapshotsConfig.java` are now byte-identical across 1.20, 2.0 and 2.1.
   
   ## Testing done
   
   - Backported `TestExpireSnapshotsConfig#configureBuilderWithoutRetainLast`, which asserts `ExpireSnapshots.builder().config(config)` does not throw for a config with no options set.
   - `:iceberg-flink:iceberg-flink-1.20:test` and `:iceberg-flink:iceberg-flink-2.0:test` with `--tests "*TestExpireSnapshotsConfig*"` — 3 tests passed on each.
   - Reverting the production change makes the new test fail with the NPE, so it covers the bug.
   - `spotlessCheck` passes on both modules.
   
   ---
   **AI Disclosure**
   - Model: Claude Opus 5
   - Platform/Tool: Claude Code
   - Human Oversight: fully reviewed
   - Prompt Summary: Backport the already-merged fix from #17277 (NPE in `ExpireSnapshots.Builder.config()` when `retain-last` is unset) and its test from the Flink 2.1 module to the Flink 2.0 and 1.20 modules in a single PR, then build and run the affected tests on both versions.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Flink: Backport fix NPE in ExpireSnapshots config when retain-last is unset to 2.0 and 1.20 [iceberg]

Posted by "huaxingao (via GitHub)" <gi...@apache.org>.
huaxingao commented on PR #17458:
URL: https://github.com/apache/iceberg/pull/17458#issuecomment-5152672125

   Thanks @thswlsqls for the PR! Thanks @uros-b for the review!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Flink: Backport fix NPE in ExpireSnapshots config when retain-last is unset to 2.0 and 1.20 [iceberg]

Posted by "huaxingao (via GitHub)" <gi...@apache.org>.
huaxingao merged PR #17458:
URL: https://github.com/apache/iceberg/pull/17458


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org