pvary commented on code in PR #14398:
URL: https://github.com/apache/iceberg/pull/14398#discussion_r2498140395


##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -402,8 +492,26 @@ public Table loadTable(SessionContext context, 
TableIdentifier identifier) {
     MetadataTableType metadataType;
     LoadTableResponse response;
     TableIdentifier loadedIdent;
+
+    Map<String, String> responseHeaders = Maps.newHashMap();
+    TableWithETag cachedTable =
+        tableCache.getIfPresent(SessionIDTableID.of(context.sessionId(), 
identifier));
+
     try {
-      response = loadInternal(context, identifier, snapshotMode);
+      response =
+          loadInternal(
+              context,
+              identifier,
+              snapshotMode,
+              headersForLoadTable(cachedTable),
+              responseHeaders::putAll);
+
+      if (response == null) {
+        Preconditions.checkNotNull(cachedTable, "Invalid response: null");

Review Comment:
   nit: Maybe a more descriptive error message would be nice. Like:
   ```
   Invalid load table response from the rest server: null
   ```



-- 
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]

Reply via email to