travis-bowen commented on code in PR #2697:
URL: https://github.com/apache/polaris/pull/2697#discussion_r2404023215
##########
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 yes - it is only to be able to control at the catalog level. It was a
suggestion from Dmitri here -
https://github.com/apache/polaris/pull/2697#discussion_r2389842728
I think it's okay - if not better performant to do it this way. Before we
would have created and resolved the manifest for each operation, which is
already required. Now, we just resolve it once here and then get the benefit of
being able to have this param be controllable at the catalog level (although
it's hard to know why someone would want this controllable at the catalog
level).
The one very small benefit of having this at the catalog level is that I can
have tests that execute both the path with this feature on and off in the same
class since otherwise it seems like the Quarkus test profile only applies at
the class level.
But happy to review this with @dennishuo as well as I already was going to
get him to review.
--
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]