gaborkaszab commented on code in PR #14398:
URL: https://github.com/apache/iceberg/pull/14398#discussion_r2610851759
##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -474,20 +601,44 @@ public Table loadTable(SessionContext context,
TableIdentifier identifier) {
tableMetadata,
endpoints);
- trackFileIO(ops);
-
BaseTable table =
new BaseTable(
ops,
fullTableName(finalIdentifier),
metricsReporter(paths.metrics(finalIdentifier), tableClient));
+
+ String eTag = responseHeaders.getOrDefault(HttpHeaders.ETAG, null);
+ if (eTag != null) {
+ BaseTable clonedTable = cloneTable(table);
+
+ trackFileIO((RESTTableOperations) clonedTable.operations());
+
+ tableCache.put(
Review Comment:
I managed to merge the 2 functionalities and resolve conflicts. I had to
make seem adjustments. to your implementation though. E.g. RESTClient is one of
the inputs for RESTTable, however, when doing my cloning of the table from
cache, the client is not available only through RESTTableOps. Hence I had to
give extra visibility to that member.
I also had to rewrite some of the code that returns RESTTable to handle the
cloning from cache.
I'd appreciate if you could take a look @singhpk234
--
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]