HonahX opened a new issue, #3378:
URL: https://github.com/apache/polaris/issues/3378

   ### Describe the bug
   
   `OPTIMIZED_SIBLING_CHECK` was added in 
https://github.com/apache/polaris/pull/1686 aims to accelerate the sibling 
check for potential table location overlap. However, it seems the feature is 
currently broken in JDBC Persistence, that any table creation will encounter:
   ```
   java.lang.ClassCastException: class 
org.apache.polaris.core.entity.PolarisBaseEntity cannot be cast to class 
org.apache.polaris.core.entity.LocationBasedEntity
       at 
org.apache.polaris.persistence.relational.jdbc.JdbcBasePersistenceImpl.hasOverlappingSiblings(JdbcBasePersistenceImpl.java:802)
       at 
org.apache.polaris.core.persistence.AtomicOperationMetaStoreManager.hasOverlappingSiblings(AtomicOperationMetaStoreManager.java:1881)
       at 
org.apache.polaris.service.catalog.iceberg.IcebergCatalog.validateNoLocationOverlap(IcebergCatalog.java:1095)
       at 
org.apache.polaris.service.catalog.iceberg.IcebergCatalog.validateNoLocationOverlap(IcebergCatalog.java:1003)
       at 
org.apache.polaris.service.catalog.iceberg.IcebergCatalog$BasePolarisTableOperations.lambda$doCommit$1(IcebergCatalog.java:1469)
   ```
   
   
   
   
   ### To Reproduce
   
   To reproduce, set `ALLOW_OPTIMIZED_SIBLING_CHECK=true` and 
`OPTIMIZED_SIBLING_CHECK=true` and run any create table statement, for example, 
add an integration test that have jdbc enabled
   ```
   @TestProfile(JdbcSparkOptimizedSiblingCheckIT.Profile.class)
   @QuarkusIntegrationTest
   public class JdbcSparkOptimizedSiblingCheckIT extends 
PolarisSparkIntegrationTest {
   
     public static class Profile extends RelationalJdbcProfile {
       @Override
       public Map<String, String> getConfigOverrides() {
         Map<String, String> overrides = new 
HashMap<>(super.getConfigOverrides());
         overrides.put("polaris.features.\"ALLOW_OPTIMIZED_SIBLING_CHECK\"", 
"true");
         overrides.put("polaris.features.\"OPTIMIZED_SIBLING_CHECK\"", "true");
         return overrides;
       }
     }
   }
   ```
   
   ### Actual Behavior
   
   _No response_
   
   ### Expected Behavior
   
   _No response_
   
   ### Additional context
   
   _No response_
   
   ### System information
   
   _No response_


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