dennishuo commented on code in PR #1296: URL: https://github.com/apache/polaris/pull/1296#discussion_r2026194538
########## service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java: ########## @@ -529,12 +528,22 @@ public Optional<LoadTableResponse> loadTableIfStale( authorizeBasicTableLikeOperationOrThrow( op, PolarisEntitySubType.ICEBERG_TABLE, tableIdentifier); - IcebergTableLikeEntity tableEntity = getTableEntity(tableIdentifier); - String tableEntityTag = - IcebergHttpUtil.generateETagForMetadataFileLocation(tableEntity.getMetadataLocation()); - - if (ifNoneMatch != null && ifNoneMatch.anyMatch(tableEntityTag)) { - return Optional.empty(); + if (ifNoneMatch != null) { + // Perform freshness-aware table loading if caller specified ifNoneMatch. + IcebergTableLikeEntity tableEntity = getTableEntity(tableIdentifier); + if (tableEntity == null || tableEntity.getMetadataLocation() == null) { + LOGGER + .atWarn() + .addKeyValue("tableIdentifier", tableIdentifier) + .addKeyValue("tableEntity", tableEntity) + .log("Failed to getMetadataLocation to generate ETag when loading table"); Review Comment: Added a TODO. I think this whole feature will probably need to be refactored somewhat once we want to have freshness-aware loading of other things too (e.g. GenericTables). -- 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...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org