Skip to content

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

Open
wombatu-kun wants to merge 1 commit 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 1 commit into
apache:mainfrom
wombatu-kun:issue/15352-flink-filesystem-fileio

Conversation

@wombatu-kun
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 ports it to all currently supported Flink lines (1.20, 2.0, 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.

Tests

TestFlinkFileSystemFileIO (added for v1.20, v2.0, 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 each of the three Flink trees; spotlessApply and checkstyle (main + test) pass on all three.

Closes #15352

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the flink label May 19, 2026
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