singhpk234 commented on code in PR #13979:
URL: https://github.com/apache/iceberg/pull/13979#discussion_r2328917054
##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -367,46 +368,67 @@ 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);
+
+ // inject the context to query params
+ Map<String, String> queryParams = Maps.newHashMap(mode.params());
+
+ Object viewIdentifierObj =
viewContext.get(ContextAwareTableCatalog.VIEW_IDENTIFIER_KEY);
+ if (viewIdentifierObj instanceof String) {
+ String viewIdentifierString = (String) viewIdentifierObj;
+ String[] parts = viewIdentifierString.split("\\.");
+ if (parts.length >= 2) {
+ String[] namespaceParts = new String[parts.length - 1];
+ System.arraycopy(parts, 0, namespaceParts, 0, parts.length - 1);
+ String viewName = parts[parts.length - 1];
+ queryParams.put(
Review Comment:
one way to look at this is anything from the last `.` to the end is the view
name and the every thing before it is the namespace, the reason `%1F` was
chosen the separator was to use something similar, the reason i choose the
`%1F` is the language of the existing rest spec for the nested namespaces.
I think we are yet to conclude on the separator discussion.
--
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]