lowka commented on code in PR #5021:
URL: https://github.com/apache/ignite-3/pull/5021#discussion_r1916020566


##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/DropSchemaCommand.java:
##########
@@ -66,17 +76,30 @@ public List<UpdateEntry> get(Catalog catalog) {
             throw new CatalogValidationException("System schema can't be 
dropped [name={}].", schemaName);
         }
 
-        CatalogSchemaDescriptor schema = schemaOrThrow(catalog, schemaName);
+        CatalogSchemaDescriptor schema;
+
+        if (ifExists) {
+            schema = catalog.schema(schemaName);
+            if (schema == null) {
+                return List.of();
+            }
+        } else {
+            schema = schemaOrThrow(catalog, schemaName);
+        }
 
         if (!cascade && !schema.isEmpty()) {
-            throw new CatalogValidationException("Schema '{}' is not empty. 
Use CASCADE to drop it anyway.", schemaName);
+            throw new SchemaNotFoundException(format("Schema '{}' is not 
empty. Use CASCADE to drop it anyway.", schemaName));

Review Comment:
   Thanks. Fixed. This was a typo.



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