dimas-b commented on code in PR #2370:
URL: https://github.com/apache/polaris/pull/2370#discussion_r2292418940
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/policy/PolicyCatalog.java:
##########
@@ -153,24 +157,46 @@ public Policy createPolicy(
return constructPolicy(resultEntity);
}
- public List<PolicyIdentifier> listPolicies(Namespace namespace, PolicyType
policyType) {
+ public List<PolicyIdentifier> listPolicies(Namespace namespace, @Nullable
PolicyType policyType) {
PolarisResolvedPathWrapper resolvedEntities =
resolvedEntityView.getResolvedPath(namespace);
if (resolvedEntities == null) {
throw new IllegalStateException(
String.format("Failed to fetch resolved namespace '%s'", namespace));
}
- List<PolarisEntity> catalogPath = resolvedEntities.getRawFullPath();
- // TODO: when the "policyType" filter is null we should only call
"listEntities" instead
+ List<PolarisEntityCore> catalogPath =
+ PolarisEntity.toCoreList(resolvedEntities.getRawFullPath());
+ if (policyType == null) {
+ // without a policyType filter we can call listEntities to acquire the
entity names
+ ListEntitiesResult listEntitiesResult =
+ metaStoreManager.listEntities(
Review Comment:
I believe this deserves a test to ensure the results are the consistent on
both call paths.
--
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]