liamzwbao commented on issue #1273:
URL: https://github.com/apache/polaris/issues/1273#issuecomment-2785017112

   Hi team, the test mentioned in this issue does not reflect Polaris's actual 
behavior — **Polaris does not allow creating a view with a 
`customMetadataLocation` outside of the `allowedLocations` defined in the 
`storageConfig`**. I've documented Polaris's behavior in PR #1320. Here's a 
summary:
   
   #### 1. View Creation with Custom Metadata Location
   
   A user **cannot create** a view with a `customMetadataLocation` outside of 
`allowedLocations` in `storageConfig`, **unless**:
   
   - The parent namespace defines the property `write.metadata.path`.
   - The `customMetadataLocation` is a subpath of that value.
   
   This behavior is enabled by [this code 
block](https://github.com/apache/polaris/blob/989e99ae51f6cef0c093a86a4e51796f99a6894d/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java#L184-L191),
 which updates the storage config to include `write.metadata.path`.
   
   **Example:**  
   If the namespace has `write.metadata.path=file://baseLocation`, then the 
view can be created at `file://baseLocation/customLocation`.
   
   #### 2. Editing View’s Metadata Location to a Sibling Path
   
   Once the view is created, the user **cannot update** its 
`customMetadataLocation` to a sibling path like 
`file://baseLocation/customLocation2`
   
   **Reason:**  
   The validation logic currently checks against the **view’s own** 
`write.metadata.path` for updating, not the parent namespace’s. 
   
   #### 3. Editing Metadata Location to a Subpath Also Fails
   
   Even updating the metadata location to a **child path** of the original is 
not allowed: `file://baseLocation/customLocation` → 
`file://baseLocation/customLocation/child`
   
   **Reason:** 
   This is rejected because the view’s properties are stored in 
`internalProperties` rather than `properties`, so the [previous config 
override](https://github.com/apache/polaris/blob/989e99ae51f6cef0c093a86a4e51796f99a6894d/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java#L184-L191)
 becomes ineffective.
   
   #### Questions
   
   - What is the **intended behavior** for this `write.metadata.path` feature?
   - The [config override 
logic](https://github.com/apache/polaris/blob/989e99ae51f6cef0c093a86a4e51796f99a6894d/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java#L184-L191)
 mentioned above doesn't appear to be covered by any existing tests. I'm 
wondering the purpose of it.
   
   
   
   


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