danielcweeks commented on code in PR #12014:
URL: https://github.com/apache/iceberg/pull/12014#discussion_r1943506895
##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -462,6 +463,26 @@ private LoadTableResponse loadInternal(
@Override
public Table loadTable(SessionContext context, TableIdentifier identifier) {
+ try {
+ return loadTableInternal(context, identifier);
+ } catch (NoSuchTableException original) {
+ return loadViewMetadataTable(context, identifier);
+ }
+ }
+
+ private Table loadViewMetadataTable(SessionContext context, TableIdentifier
identifier) {
+ String tableName = identifier.name();
+ ViewMetadataTableType type = ViewMetadataTableType.from(tableName);
+ if (type != null) {
+ TableIdentifier baseViewIdentifier =
TableIdentifier.of(identifier.namespace().levels());
+ View baseView = loadView(context, baseViewIdentifier);
Review Comment:
I believe this will break for catalogs not implementing views, because it's
going to throw.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]