dimas-b commented on code in PR #4580:
URL: https://github.com/apache/polaris/pull/4580#discussion_r3338118879


##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java:
##########
@@ -810,11 +811,21 @@ Optional<Optional<String>> hasOverlappingSiblings(
       if (!results.isEmpty()) {
         StorageLocation entityLocation = 
StorageLocation.of(entity.getBaseLocation());
         for (PolarisBaseEntity result : results) {
-          StorageLocation potentialSiblingLocation =
-              StorageLocation.of(((LocationBasedEntity) 
result).getBaseLocation());
-          if (entityLocation.isChildOf(potentialSiblingLocation)
-              || potentialSiblingLocation.isChildOf(entityLocation)) {
-            return 
Optional.of(Optional.of(potentialSiblingLocation.toString()));
+          // JDBC materializes persisted rows as PolarisBaseEntity; resolve 
location via entity
+          // utils
+          // instead of casting to LocationBasedEntity.

Review Comment:
   nit: better line wraps



##########
persistence/relational-jdbc/src/test/java/org/apache/polaris/persistence/relational/jdbc/AtomicMetastoreManagerWithJdbcBasePersistenceImplTest.java:
##########
@@ -79,6 +89,84 @@ protected PolarisTestMetaStoreManager 
createPolarisTestMetaStoreManager() {
     return new PolarisTestMetaStoreManager(metaStoreManager, callCtx);
   }
 
+  @Test
+  void testHasOverlappingSiblingsUsesStoredBaseLocation() {
+    // The optimized check relies on the location_without_scheme column added 
in schema v2.
+    if (schemaVersion() < 2) {
+      return;

Review Comment:
   nit: `assumeThat(schemaVersion()).isLessThan(2)`?



-- 
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]

Reply via email to