You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "rmoff (via GitHub)" <gi...@apache.org> on 2026/04/22 15:03:14 UTC
[PR] Flink: Throw UnsupportedOperationException for materialized tables [iceberg]
rmoff opened a new pull request, #16079:
URL: https://github.com/apache/iceberg/pull/16079
## 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()`.
This 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."*
Implemented for Flink 2.1. Backports to v2.0 and v1.20 to follow if the approach looks good.
## 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
- [x] Added `testCreateMaterializedTableIsUnsupported` in `TestFlinkCatalogTable` (runs across all 3 catalog parametrizations)
- [x] `spotlessCheck` passes
- [x] Existing `TestFlinkCatalogTable` tests unaffected
--
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: Throw UnsupportedOperationException for materialized tables [iceberg]
Posted by "rmoff (via GitHub)" <gi...@apache.org>.
rmoff commented on code in PR #16079:
URL: https://github.com/apache/iceberg/pull/16079#discussion_r3324723659
##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java:
##########
@@ -426,6 +427,11 @@ public void createTable(ObjectPath tablePath, CatalogBaseTable table, boolean ig
+ "create table without 'connector'='iceberg' related properties in an iceberg table.");
}
+ if (table instanceof CatalogMaterializedTable) {
+ throw new UnsupportedOperationException(
+ "Materialized tables are not supported by Iceberg's Flink catalog.");
+ }
+
Preconditions.checkArgument(table instanceof ResolvedCatalogTable, "table should be resolved");
Review Comment:
@pvary Happy to update it. what do you have in mind?
--
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: Throw UnsupportedOperationException for materialized tables [iceberg]
Posted by "rmoff (via GitHub)" <gi...@apache.org>.
rmoff commented on code in PR #16079:
URL: https://github.com/apache/iceberg/pull/16079#discussion_r3473444216
##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java:
##########
@@ -426,7 +427,17 @@ public void createTable(ObjectPath tablePath, CatalogBaseTable table, boolean ig
+ "create table without 'connector'='iceberg' related properties in an iceberg table.");
}
- Preconditions.checkArgument(table instanceof ResolvedCatalogTable, "table should be resolved");
+ if (table instanceof CatalogMaterializedTable) {
+ throw new UnsupportedOperationException(
+ "Materialized tables are not supported by Iceberg's Flink catalog.");
+ }
Review Comment:
that's fair. I've updated the PR.
--
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: Throw UnsupportedOperationException for materialized tables [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary merged PR #16079:
URL: https://github.com/apache/iceberg/pull/16079
--
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: Throw UnsupportedOperationException for materialized tables [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on code in PR #16079:
URL: https://github.com/apache/iceberg/pull/16079#discussion_r3340793866
##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java:
##########
@@ -426,6 +427,11 @@ public void createTable(ObjectPath tablePath, CatalogBaseTable table, boolean ig
+ "create table without 'connector'='iceberg' related properties in an iceberg table.");
}
+ if (table instanceof CatalogMaterializedTable) {
+ throw new UnsupportedOperationException(
+ "Materialized tables are not supported by Iceberg's Flink catalog.");
+ }
+
Preconditions.checkArgument(table instanceof ResolvedCatalogTable, "table should be resolved");
Review Comment:
Maybe:
```suggestion
Preconditions.checkArgument(
table instanceof ResolvedCatalogTable,
"Expected a ResolvedCatalogTable but got: %s. "
+ "Iceberg Flink catalog only supports resolved catalog tables "
+ "(materialized tables and other table kinds are not supported).",
table == null ? "null" : table.getClass().getName());```
--
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: Throw UnsupportedOperationException for materialized tables [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on PR #16079:
URL: https://github.com/apache/iceberg/pull/16079#issuecomment-4798720618
Merged to main.
Thanks @rmoff for the improvement.
Please don't forget to backport to other Flink branches
--
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: Throw UnsupportedOperationException for materialized tables [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on code in PR #16079:
URL: https://github.com/apache/iceberg/pull/16079#discussion_r3461279858
##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java:
##########
@@ -426,7 +427,17 @@ public void createTable(ObjectPath tablePath, CatalogBaseTable table, boolean ig
+ "create table without 'connector'='iceberg' related properties in an iceberg table.");
}
- Preconditions.checkArgument(table instanceof ResolvedCatalogTable, "table should be resolved");
+ if (table instanceof CatalogMaterializedTable) {
+ throw new UnsupportedOperationException(
+ "Materialized tables are not supported by Iceberg's Flink catalog.");
+ }
Review Comment:
It was a long time ago when we last discussed this, but do we really need a dedicated instanceof CatalogMaterializedTable check here?
Wouldn't the generic check below handle the situation correctly and provide users with enough information to understand and fix the issue on their side?
--
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: Throw UnsupportedOperationException for materialized tables [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16079:
URL: https://github.com/apache/iceberg/pull/16079#issuecomment-4523572101
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.
--
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: Throw UnsupportedOperationException for materialized tables [iceberg]
Posted by "rmoff (via GitHub)" <gi...@apache.org>.
rmoff commented on PR #16079:
URL: https://github.com/apache/iceberg/pull/16079#issuecomment-4543755060
This is not stale, just needs a 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: Throw UnsupportedOperationException for materialized tables [iceberg]
Posted by "rmoff (via GitHub)" <gi...@apache.org>.
rmoff commented on PR #16079:
URL: https://github.com/apache/iceberg/pull/16079#issuecomment-4691440633
@pvary done, thanks.
--
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: Throw UnsupportedOperationException for materialized tables [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on code in PR #16079:
URL: https://github.com/apache/iceberg/pull/16079#discussion_r3303382791
##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java:
##########
@@ -426,6 +427,11 @@ public void createTable(ObjectPath tablePath, CatalogBaseTable table, boolean ig
+ "create table without 'connector'='iceberg' related properties in an iceberg table.");
}
+ if (table instanceof CatalogMaterializedTable) {
+ throw new UnsupportedOperationException(
+ "Materialized tables are not supported by Iceberg's Flink catalog.");
+ }
+
Preconditions.checkArgument(table instanceof ResolvedCatalogTable, "table should be resolved");
Review Comment:
I think this is the issue with the error message here. Could we be more explicit which could help the users?
--
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: Throw UnsupportedOperationException for materialized tables [iceberg]
Posted by "rmoff (via GitHub)" <gi...@apache.org>.
rmoff commented on PR #16079:
URL: https://github.com/apache/iceberg/pull/16079#issuecomment-4799451686
thanks @pvary for the patience with the reviews :)
here is the backport PR: https://github.com/apache/iceberg/pull/16959
--
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: Throw UnsupportedOperationException for materialized tables [iceberg]
Posted by "rmoff (via GitHub)" <gi...@apache.org>.
rmoff commented on PR #16079:
URL: https://github.com/apache/iceberg/pull/16079#issuecomment-4683370566
@pvary would you mind taking another look at this please? thanks.
--
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: Throw UnsupportedOperationException for materialized tables [iceberg]
Posted by "pvary (via GitHub)" <gi...@apache.org>.
pvary commented on PR #16079:
URL: https://github.com/apache/iceberg/pull/16079#issuecomment-4690637843
@rmoff: You need to fix the test failures. I guess this is a formatting issue at this point. Please use spotless to correctly format the new code
--
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