zstan commented on code in PR #5021:
URL: https://github.com/apache/ignite-3/pull/5021#discussion_r1915955839
##########
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:
SchemaNotFoundException and in same time: Schema '{}' is not empty, sound
strange.
##########
modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlApiBaseTest.java:
##########
@@ -97,9 +97,8 @@ public abstract class ItSqlApiBaseTest extends
BaseSqlIntegrationTest {
@AfterEach
public void dropTables() {
Review Comment:
```suggestion
public void dropTablesAndSchemas() {
```
--
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]