Skip to content

Flink: Throw UnsupportedOperationException for materialized tables#16079

Open
rmoff wants to merge 1 commit intoapache:mainfrom
rmoff:worktree-materialized-table-error
Open

Flink: Throw UnsupportedOperationException for materialized tables#16079
rmoff wants to merge 1 commit intoapache:mainfrom
rmoff:worktree-materialized-table-error

Conversation

@rmoff
Copy link
Copy Markdown
Contributor

@rmoff rmoff commented Apr 22, 2026

Summary

Creating a materialized table in Flink using an Iceberg catalog currently fails with a
cryptic IllegalArgumentException: table should be resolved from a Preconditions.checkArgument
deep in FlinkCatalog.createTable(). See #15318 for occurrence raised by a user.

This PR adds an explicit instanceof CatalogMaterializedTable check before that precondition,
throwing a clear UnsupportedOperationException with the message:
"Materialized tables are not supported by Iceberg's Flink catalog."

Before

Caused by: java.lang.IllegalArgumentException: table should be resolved
    at org.apache.iceberg.flink.FlinkCatalog.createTable(FlinkCatalog.java:429)

After

UnsupportedOperationException: Materialized tables are not supported by Iceberg's Flink catalog.

Test plan

  • Added testCreateMaterializedTableIsUnsupported in TestFlinkCatalogTable (runs across all 3 catalog parametrizations)
  • spotlessCheck passes
  • Existing TestFlinkCatalogTable tests unaffected

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the flink label Apr 22, 2026
@rmoff rmoff marked this pull request as ready for review April 22, 2026 16:16
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.

1 participant