travis-bowen commented on code in PR #2697:
URL: https://github.com/apache/polaris/pull/2697#discussion_r2408319679
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/common/CatalogHandler.java:
##########
@@ -238,29 +241,52 @@ protected void
authorizeCreateTableLikeUnderNamespaceOperationOrThrow(
initializeCatalog();
}
+ /**
+ * Ensures resolution manifest is initialized for a table identifier. This
allows checking
+ * catalog-level feature flags or other resolved entities before
authorization. If already
+ * initialized, this is a no-op.
+ */
+ protected void ensureResolutionManifestForTable(TableIdentifier identifier) {
+ if (resolutionManifest == null) {
+ resolutionManifest =
+ resolutionManifestFactory.createResolutionManifest(
+ callContext, securityContext, catalogName);
+
+ // The underlying Catalog is also allowed to fetch "fresh" versions of
the target entity.
+ resolutionManifest.addPassthroughPath(
+ new ResolverPath(
+ PolarisCatalogHelpers.tableIdentifierToList(identifier),
+ PolarisEntityType.TABLE_LIKE,
+ true /* optional */),
+ identifier);
+ resolutionManifest.resolveAll();
+ }
+ }
Review Comment:
So, went ahead and kept things as they are currently.
There shouldn't be any risk of resolving the path twice because I updated
even the CatalogHandler to use ensureResolutionManifestForTable which only
resolves if it's null.
Let me know if I might have missed something though.
--
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]