travis-bowen opened a new pull request, #3693:
URL: https://github.com/apache/polaris/pull/3693

   During drop commands, Apache Polaris would make assumptions based on the 
entity type as to why the entity could not be dropped which could lead to 
incorrect user error messaging and handling.
   
   Here I tackle updating error handling for DropTable, DropNamespace, and 
DropView.
   
   The Catalog API javadocs by Iceberg indicate false should indicate 
[TableNotExists] (and simila for View) 
(https://github.com/apache/iceberg/blob/a8ece055ba93adc0c046db29b6b7b5edaf35d4da/api/src/main/java/org/apache/iceberg/catalog/Catalog.java#L292).
   
   For Namespaces [it's less 
clear]((https://github.com/apache/iceberg/blob/a8ece055ba93adc0c046db29b6b7b5edaf35d4da/api/src/main/java/org/apache/iceberg/catalog/SupportsNamespaces.java#L120)
 ), but I assume the same holds and we treat it to follow the same logic that 
false = Not Found in CatalogHandlerUtils.
   
   **Before**
   Any non success in Polaris's IcebergCatalog impl would return false.
   Polaris's 
[CatalogHandlerUtils](https://github.com/apache/polaris/blob/6a516e0976f549ec4326f1de6b1324520c2a1f38/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/CatalogHandlerUtils.java#L364)
 would interpret this false to mean the entity did not exist and would throw 
the appropriate does not exist error
   
   However, the reason that it returned false, may not truly be that it didn't 
exist.
   
   **After**
   The IcebergCatalog impl in Polaris uses the return status of the persistence 
result to determine whether or not the drop failure was due to being not found. 
If not found, it returns false per the interface definition, which the 
CatalogHandlerUtil transforms into the appropriate not found exception. 
Otherwise it throws it's own error corresponding to the cause.
   
   Ran tests locally + S3 Tests with drop
   <img width="1470" height="235" alt="Screenshot 2026-02-06 at 3 57 35 PM" 
src="https://github.com/user-attachments/assets/ad9e9647-7fd9-4812-a63a-16488a3ad590";
 />
   <img width="1133" height="60" alt="Screenshot 2026-02-06 at 3 57 21 PM" 
src="https://github.com/user-attachments/assets/cd70e96c-6e92-4135-8c14-67eeda0d4267";
 />
   
   ## Checklist
   - [ ] 🛡️ Don't disclose security issues! (contact [email protected])
   - [ ] 🔗 Clearly explained why the changes are needed, or linked related 
issues: Fixes #
   - [ ] 🧪 Added/updated tests with good coverage, or manually tested (and 
explained how)
   - [ ] 💡 Added comments for complex logic
   - [ ] 🧾 Updated `CHANGELOG.md` (if needed)
   - [ ] 📚 Updated documentation in `site/content/in-dev/unreleased` (if needed)
   


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