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


##########
modules/runner/src/testFixtures/java/org/apache/ignite/internal/ClusterPerClassIntegrationTest.java:
##########
@@ -168,8 +174,46 @@ void stopCluster() {
 
     /** Drops all visible tables. */
     protected static void dropAllTables() {
-        for (Table t : CLUSTER.aliveNode().tables().tables()) {
-            sql("DROP TABLE " + t.name());
+        Ignite aliveNode = CLUSTER.aliveNode();
+
+        for (Table t : aliveNode.tables().tables()) {
+            IgniteImpl ignite = unwrapIgniteImpl(aliveNode);
+            CatalogManager catalogManager = ignite.catalogManager();
+
+            int latestCatalogVersion = catalogManager.latestCatalogVersion();
+            Catalog latestCatalog = 
catalogManager.catalog(latestCatalogVersion);
+            assert latestCatalog != null;
+
+            TableImpl tableImpl = unwrapTableImpl(t);
+            int tableId = tableImpl.tableId();
+
+            for (CatalogSchemaDescriptor schema : latestCatalog.schemas()) {
+                for (CatalogTableDescriptor table : schema.tables()) {
+                    if (table.id() != tableId) {
+                        continue;
+                    }
+                    sql("DROP TABLE " + QualifiedName.of(schema.name(), 
table.name()).toCanonicalForm());
+                }
+            }
+        }
+    }
+
+    /** Drops all non-system schemas. */
+    protected static void dropAllSchemas() {
+        Ignite aliveNode = CLUSTER.aliveNode();
+        IgniteImpl ignite = unwrapIgniteImpl(aliveNode);
+        CatalogManager catalogManager = ignite.catalogManager();
+
+        int latestCatalogVersion = catalogManager.latestCatalogVersion();
+        Catalog latestCatalog = catalogManager.catalog(latestCatalogVersion);
+        assert latestCatalog != null;
+
+        for (CatalogSchemaDescriptor schema : latestCatalog.schemas()) {
+            String schemaName = schema.name();

Review Comment:
   Thanks fixed.



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