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


##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -413,14 +521,34 @@ public Table loadTable(SessionContext context, 
TableIdentifier identifier) {
         // attempt to load a metadata table using the identifier's namespace 
as the base table
         TableIdentifier baseIdent = 
TableIdentifier.of(identifier.namespace().levels());
         try {
-          response = loadInternal(context, baseIdent, snapshotMode);
+          responseHeaders.clear();
+          cachedTable =
+              tableCache.getIfPresent(SessionIDTableID.of(context.sessionId(), 
baseIdent));
+
+          response =
+              loadInternal(
+                  context,
+                  baseIdent,
+                  snapshotMode,
+                  headersForLoadTable(cachedTable),

Review Comment:
   Thank you for the explanation, @XJDKC !
   I see your point. At the moment ETag handling, and answering from cache is 
deliberately kept internal to RESTSessionCatalog. One of the requirements when 
designing this was to not change existing interfaces or introduce new ones. 
Maybe we can re-visit this later on, but for simplicity and keeping the API 
clean I don't think we should provide a way to provide external ETags through 
the loadTable API
   Additional observation I have is ETags are coming from the REST server, and 
are kept within the RESTSessionCatalog, but not persisted into the table 
object, nor into the table ops, so the users of loadTable API won't have a way 
to get the ETag of a table other than calculating it themselves. However, that 
goes against the purpose of an ETag, as it should be opaque to the clients.



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