EdenKik opened a new issue, #13915:
URL: https://github.com/apache/iceberg/issues/13915

   ### Apache Iceberg version
   
   None
   
   ### Query engine
   
   None
   
   ### Please describe the bug 🐞
   
   When using Iceberg with a the REST fixture catalog, certain operations (like 
querying a table, or creating a namespace/table) incorrectly throw exceptions 
such as NoSuchViewException or NoSuchNamespaceException, even though the 
operation succeeds.
   These exceptions are misleading and suggest a failure where there is none, 
making debugging and log tracing more difficult.
   
   When using a JDBC catalog implementation with the REST fixture, the 
createNamespace method performs an existence check before attempting creation — 
which is good:
   ```
   public void createNamespace(Namespace namespace, Map<String, String> 
metadata) {
     if (namespaceExists(namespace)) {
       throw new AlreadyExistsException("Namespace already exists: %s", 
namespace);
     }
   ```
   
   However, the namespaceExists() utility is implemented as:
   ```
   public static void namespaceExists(SupportsNamespaces catalog, Namespace 
namespace) {
     if (!catalog.namespaceExists(namespace)) {
       throw new NoSuchNamespaceException("Namespace does not exist: %s", 
namespace);
     }
   }
   ```
   
   A similar issue happens when querying a table:
   Even though the table exists and the query succeeds, a NoSuchViewException 
is thrown during the resolution phase - likely due to the lookup logic 
attempting to resolve the identifier as a view first and throwing prematurely 
when the view is not found.
   
   Let me know if this is the expected behavior or if a change is required 
here. 
   
   
   ### Willingness to contribute
   
   - [ ] I can contribute a fix for this bug independently
   - [ ] I would be willing to contribute a fix for this bug with guidance from 
the Iceberg community
   - [ ] I cannot contribute a fix for this bug at this time


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to