RussellSpitzer commented on code in PR #193:
URL: https://github.com/apache/polaris/pull/193#discussion_r1730624069
##########
polaris-service/src/main/java/io/polaris/service/catalog/BasePolarisCatalog.java:
##########
@@ -1169,12 +1190,31 @@ public void doCommit(TableMetadata base, TableMetadata
metadata) {
: resolvedTableEntities.getRawParentPath();
CatalogEntity catalog = CatalogEntity.of(resolvedNamespace.getFirst());
- if (base == null || !metadata.location().equals(base.location())) {
+ if (base == null
+ || !metadata.location().equals(base.location())
+ || !Objects.equal(
+
base.properties().get(TableLikeEntity.USER_SPECIFIED_WRITE_DATA_LOCATION_KEY),
+
metadata.properties().get(TableLikeEntity.USER_SPECIFIED_WRITE_DATA_LOCATION_KEY)))
{
// If location is changing then we must validate that the requested
location is valid
// for the storage configuration inherited under this entity's path.
- validateLocationForTableLike(tableIdentifier, metadata.location(),
resolvedStorageEntity);
- // also validate that the view location doesn't overlap an existing
table
- validateNoLocationOverlap(tableIdentifier, resolvedNamespace,
metadata.location());
+ Set<String> dataLocations = new HashSet<>();
+ dataLocations.add(metadata.location());
+ if
(metadata.properties().get(TableLikeEntity.USER_SPECIFIED_WRITE_DATA_LOCATION_KEY)
Review Comment:
computeIfPresent? May work here?
##########
polaris-service/src/main/java/io/polaris/service/catalog/BasePolarisCatalog.java:
##########
@@ -1169,12 +1190,31 @@ public void doCommit(TableMetadata base, TableMetadata
metadata) {
: resolvedTableEntities.getRawParentPath();
CatalogEntity catalog = CatalogEntity.of(resolvedNamespace.getFirst());
- if (base == null || !metadata.location().equals(base.location())) {
+ if (base == null
+ || !metadata.location().equals(base.location())
+ || !Objects.equal(
+
base.properties().get(TableLikeEntity.USER_SPECIFIED_WRITE_DATA_LOCATION_KEY),
+
metadata.properties().get(TableLikeEntity.USER_SPECIFIED_WRITE_DATA_LOCATION_KEY)))
{
// If location is changing then we must validate that the requested
location is valid
// for the storage configuration inherited under this entity's path.
- validateLocationForTableLike(tableIdentifier, metadata.location(),
resolvedStorageEntity);
- // also validate that the view location doesn't overlap an existing
table
- validateNoLocationOverlap(tableIdentifier, resolvedNamespace,
metadata.location());
+ Set<String> dataLocations = new HashSet<>();
+ dataLocations.add(metadata.location());
+ if
(metadata.properties().get(TableLikeEntity.USER_SPECIFIED_WRITE_DATA_LOCATION_KEY)
Review Comment:
computeIfPresent May work here?
--
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]