AMashenkov commented on code in PR #6011:
URL: https://github.com/apache/ignite-3/pull/6011#discussion_r2144707484


##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/jdbc/JdbcMetadataCatalog.java:
##########
@@ -129,25 +149,69 @@ private 
CompletableFuture<Collection<CatalogTableDescriptor>> tablesAtNow() {
      * @param tblTypes       Requested table types.
      * @return Future of the list of metadatas of tables that matches.
      */
-    public CompletableFuture<List<JdbcTableMeta>> getTablesMeta(String 
schemaNamePtrn, String tblNamePtrn, String[] tblTypes) {
+    public CompletableFuture<List<JdbcTableMeta>> getTablesMeta(String 
schemaNamePtrn, String tblNamePtrn, @Nullable String[] tblTypes) {
         String schemaNameRegex = translateSqlWildcardsToRegex(schemaNamePtrn);
         String tlbNameRegex = translateSqlWildcardsToRegex(tblNamePtrn);
-
-        return tablesAtNow().thenApply(tables -> {
-            return tables.stream()
-                    .filter(t -> tableNameAndSchemaMatches(t, schemaNameRegex, 
tlbNameRegex))
-                    .sorted(byTblTypeThenSchemaThenTblName)
-                    .map(t -> new JdbcTableMeta(SqlCommon.DEFAULT_SCHEMA_NAME, 
t.name(), TBL_TYPE))
-                    .collect(toList());
-        });
+        boolean[] includedTblTypes = resolveTableTypes(tblTypes);
+
+        return schemasAtNow().thenApply(schemas ->
+                schemas.stream()
+                        .filter(schema -> matches(schema.name(), 
schemaNameRegex))
+                        .flatMap(schema -> {
+                            Stream<JdbcTableMeta> tablesStream = 
includedTblTypes[TYPE_TABLE_IDX]

Review Comment:
   String[] types;
   schema;
   
   types.stream().map(type -> getCatalogObjects(schema, type))
   .filter(o -> matches(o.name(), tlbNameRegex))
                                       .map(t -> new 
JdbcTableMeta(schema.name(), t.name(), type))



-- 
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: notifications-unsubscr...@ignite.apache.org

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

Reply via email to