nastra commented on code in PR #13979: URL: https://github.com/apache/iceberg/pull/13979#discussion_r2367400766
########## core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java: ########## @@ -367,46 +369,77 @@ public boolean tableExists(SessionContext context, TableIdentifier identifier) { } private LoadTableResponse loadInternal( - SessionContext context, TableIdentifier identifier, SnapshotMode mode) { + SessionContext context, + TableIdentifier identifier, + SnapshotMode mode, + Map<String, Object> viewContext) { Endpoint.check(endpoints, Endpoint.V1_LOAD_TABLE); AuthSession contextualSession = authManager.contextualSession(context, catalogAuth); + return client .withAuthSession(contextualSession) .get( paths.table(identifier), - mode.params(), + referencedByToQueryParam(mode.params(), viewContext), LoadTableResponse.class, Map.of(), ErrorHandlers.tableErrorHandler()); } + private Map<String, String> referencedByToQueryParam( + Map<String, String> params, Map<String, Object> context) { + if (context.isEmpty() || !context.containsKey(ContextAwareTableCatalog.VIEW_IDENTIFIER_KEY)) { + return params; + } + + Map<String, String> queryParams = Maps.newHashMap(params); + Object viewIdentifierObj = context.get(ContextAwareTableCatalog.VIEW_IDENTIFIER_KEY); + + if (!(viewIdentifierObj instanceof String)) { Review Comment: I guess this needs to be updated to reflect the spec changes from https://github.com/apache/iceberg/pull/13810 where the context is a list of identifiers? -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org