diqiu50 commented on code in PR #4497:
URL: https://github.com/apache/gravitino/pull/4497#discussion_r1714736723


##########
trino-connector/src/main/java/org/apache/gravitino/trino/connector/system/table/GravitinoSystemTableCatalog.java:
##########
@@ -56,21 +60,35 @@ public GravitinoSystemTableCatalog(CatalogConnectorManager 
catalogConnectorManag
 
   @Override
   public Page loadPageData() {
-    List<GravitinoCatalog> catalogs = catalogConnectorManager.getCatalogs();
-    int size = catalogs.size();
+    List<GravitinoCatalog> gravitinoCatalogs = new ArrayList<>();
+    catalogConnectorManager
+        .getUsedMetalakes()
+        .forEach(
+            (metalakeName) -> {
+              GravitinoMetalake metalake = 
catalogConnectorManager.getMetalake(metalakeName);
+              String[] catalogNames = metalake.listCatalogs();
+              for (String catalogName : catalogNames) {
+                Catalog catalog = metalake.loadCatalog(catalogName);
+                if (catalog.type() == Catalog.Type.RELATIONAL) {
+                  gravitinoCatalogs.add(new GravitinoCatalog(metalakeName, 
catalog));
+                }
+              }
+            });
+    int size = gravitinoCatalogs.size();
 

Review Comment:
   In the Trino worker node. catalogs can not load to the 
`catalogConnectorManager`, we can retrieve catalogs from the server



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