haizhou-zhao opened a new issue, #8832:
URL: https://github.com/apache/iceberg/issues/8832

   ### Apache Iceberg version
   
   main (development)
   
   ### Query engine
   
   Other
   
   ### Please describe the bug 🐞
   
   Currently, JdbcCatalog relies on this sql statement to check whether a 
namespace exists:
   
   `"SELECT TABLE_NAMESPACE  FROM CATALOG_TABLE_NAME WHERE CATALOG_NAME  = {} 
AND  TABLE_NAMESPACE  LIKE {}% LIMIT 1"`
   
   It gives undesired result in this scenario:
   
   1. Create a namespace `my_ns`
   2. Create a namespace `my_ns_1`
   3. Create a table `my_ns_1.tbl1`
   4. Drop namespace `my_ns`
   5. Check namespace exists on `my_ns` will return true, which should have 
been false
   
   It happens because, at step 5, `my_ns_1` still exists and matches query 
`"SELECT TABLE_NAMESPACE  FROM CATALOG_TABLE_NAME WHERE CATALOG_NAME  = jdbc 
AND  TABLE_NAMESPACE  LIKE my_ns% LIMIT 1"`. I believe the root cause is that 
particular sql statement, with regex like "my_ns%", cannot different between 
"my_ns" and "my_ns_1".


-- 
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: issues-unsubscr...@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to