Skip to content

Flink: Add FlinkFileSystemFileIO delegating to Flink's FileSystem - #16411

Open
wombatu-kun wants to merge 2 commits into
apache:mainfrom
wombatu-kun:issue/15352-flink-filesystem-fileio
Open

Flink: Add FlinkFileSystemFileIO delegating to Flink's FileSystem#16411
wombatu-kun wants to merge 2 commits into
apache:mainfrom
wombatu-kun:issue/15352-flink-filesystem-fileio

Conversation

@wombatu-kun

@wombatu-kun wombatu-kun commented May 19, 2026

Copy link
Copy Markdown
Contributor

What & why

Resolves #15352.

Flink ships pluggable FileSystem implementations (S3, HDFS, GCS, ...) that a Flink job already configures once for checkpoints and savepoints, including delegation-token and plugin-based authentication. Until now an Iceberg-on-Flink user had to separately re-configure Iceberg's FileIO for the same storage. FlinkFileSystemFileIO is a FileIO that discovers and delegates to Flink's FileSystem, removing the duplicate configuration and inheriting Flink FileSystem features such as delegation tokens (only the JobManager authenticates with Kerberos; TaskManagers reuse the token).

It is opt-in via the catalog's io-impl property (CatalogProperties.FILE_IO_IMPL) and must not be set through table properties, since other engines cannot use Flink's FileSystem. There are no core/api changes, so core stays engine-agnostic.

This revives #10151 by @pvary, which was closed only by the stale bot for inactivity, and targets the default Flink line (2.1) with a few modernizations:

  • Implements the DelegateFileIO marker (FileIO + SupportsPrefixOperations + SupportsBulkOperations), mirroring HadoopFileIO, so it can also serve as a ResolvingFileIO delegate.
  • FlinkOutputFile.create() no longer reaches for a Hadoop exception type; it performs a Flink-native existence check and throws Iceberg's AlreadyExistsException, honoring the "no Hadoop where FileIO abstractions exist" boundary.
  • Stream wrappers use the current core finalize() suppression form.
  • Tests use Flink's own KryoSerializer (via the Flink module TestHelpers), the faithful way to verify serializability for Flink, which also avoids esotericsoftware Kryo version skew across Flink lines so no extra test dependency is needed.

Follow-up PRs will port the same change to the other supported Flink lines (1.20 and 2.0).

Tests

TestFlinkFileSystemFileIO (added for v2.1): list-prefix at scale, file existence, prefix delete, bulk delete + bulk-delete error handling, read/write roundtrip, and Flink Kryo + Java serialization. All 8 tests pass on the v2.1 tree; spotlessApply and checkstyle (main + test) pass.

Closes #15352


AI Disclosure

  • Model: Claude Opus 4.7
  • Platform/Tool: Claude Code
  • Human Oversight: fully reviewed
  • Prompt Summary: Add FlinkFileSystemFileIO, delegating to Flink's own pluggable FileSystem.

@github-actions github-actions Bot added the flink label May 19, 2026
@wombatu-kun
wombatu-kun force-pushed the issue/15352-flink-filesystem-fileio branch 2 times, most recently from e50b69e to 16a2159 Compare June 10, 2026 01:50
@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Generated-by: Claude Opus 5 (1M context)
@wombatu-kun
wombatu-kun force-pushed the issue/15352-flink-filesystem-fileio branch from a51504c to 9a674e6 Compare September 10, 2026 03:59
…rPool

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0199zqP4fzgJdmPufkMaiamu
Generated-by: Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flink Iceberg should support Flink's IOs in addition to Iceberg's IO

1 participant