Skip to content

Flink: Throw UnsupportedOperationException for materialized tables#16079

Open
rmoff wants to merge 2 commits into
apache:mainfrom
rmoff:worktree-materialized-table-error
Open

Flink: Throw UnsupportedOperationException for materialized tables#16079
rmoff wants to merge 2 commits into
apache: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
@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.

@github-actions github-actions Bot added the stale label May 23, 2026
@rmoff
Copy link
Copy Markdown
Contributor Author

rmoff commented May 26, 2026

This is not stale, just needs a review :)

throw new UnsupportedOperationException(
"Materialized tables are not supported by Iceberg's Flink catalog.");
}

Preconditions.checkArgument(table instanceof ResolvedCatalogTable, "table should be resolved");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the issue with the error message here. Could we be more explicit which could help the users?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants