flyrain commented on code in PR #585:
URL: https://github.com/apache/polaris/pull/585#discussion_r1893291410
##########
service/common/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java:
##########
@@ -554,14 +554,27 @@ private String resolveNamespaceLocation(Namespace
namespace, Map<String, String>
.map(
entity -> {
if (entity.getType().equals(PolarisEntityType.CATALOG)) {
- return CatalogEntity.of(entity).getDefaultBaseLocation();
+ CatalogEntity catEntity = CatalogEntity.of(entity);
+ String catalogDefaultBaseLocation =
catEntity.getDefaultBaseLocation();
Review Comment:
Minor suggestion: we can keep them in one line by:
```
var catalogDefaultBaseLocation =
CatalogEntity.of(entity).getDefaultBaseLocation();
```
##########
service/common/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java:
##########
@@ -554,14 +554,27 @@ private String resolveNamespaceLocation(Namespace
namespace, Map<String, String>
.map(
entity -> {
if (entity.getType().equals(PolarisEntityType.CATALOG)) {
Review Comment:
Refactor suggestion: would the code be cleaner if we put these into a new
method like
```
private static String baseLocation(PolarisEntity entity) {
if (entity.getType().equals(PolarisEntityType.CATALOG)) {
return CatalogEntity.of(entity).getDefaultBaseLocation();
} else {
String baseLocation =
entity.getPropertiesAsMap().get(PolarisEntityConstants.ENTITY_BASE_LOCATION);
if (baseLocation != null) {
return baseLocation;
} else {
return entity.getName();
}
}
}
```
--
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]