adutra commented on code in PR #4506:
URL: https://github.com/apache/polaris/pull/4506#discussion_r3323658780
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/common/CatalogHandler.java:
##########
@@ -215,6 +215,53 @@ protected void
authorizeCreateTableLikeUnderNamespaceOperationOrThrow(
initializeCatalog();
}
+ /**
+ * Authorizes a register-table-with-overwrite operation. If the table
already exists, {@code
+ * REGISTER_TABLE_OVERWRITE} is authorized against the table entity. If the
table does not exist,
+ * {@code REGISTER_TABLE} is authorized against the parent namespace.
+ */
+ protected void authorizeRegisterTableOverwriteOrThrow(TableIdentifier
identifier) {
+ Namespace namespace = identifier.namespace();
+ resolutionManifest = newResolutionManifest();
+ resolutionManifest.addPath(
+ new ResolverPath(Arrays.asList(namespace.levels()),
PolarisEntityType.NAMESPACE));
+ resolutionManifest.addPassthroughPath(
+ new ResolverPath(
+ PolarisCatalogHelpers.tableIdentifierToList(identifier),
+ PolarisEntityType.TABLE_LIKE,
+ true /* optional */));
+ resolutionManifest.resolveAll();
+
+ PolarisResolvedPathWrapper tableTarget =
+ resolutionManifest.getResolvedPath(
Review Comment:
Fair enough, I introduced a view conflict detection logic, PTAL.
--
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]