AMashenkov commented on code in PR #6011: URL: https://github.com/apache/ignite-3/pull/6011#discussion_r2144876503
########## modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/jdbc/JdbcMetadataCatalog.java: ########## @@ -165,19 +229,29 @@ public CompletableFuture<Collection<JdbcColumnMeta>> getColumnsMeta(String schem String tlbNameRegex = translateSqlWildcardsToRegex(tblNamePtrn); String colNameRegex = translateSqlWildcardsToRegex(colNamePtrn); - return tablesAtNow().thenApply(tablesList -> tablesList.stream() - .filter(t -> tableNameAndSchemaMatches(t, schemaNameRegex, tlbNameRegex)) - .flatMap( - tbl -> { - SchemaDescriptor schema = CatalogToSchemaDescriptorConverter.convert(tbl, tbl.tableVersion()); - - return schema.columns().stream() - .map(column -> new Pair<>(tbl.name(), column)); - }) - .filter(e -> matches(e.getSecond().name(), colNameRegex)) - .sorted(bySchemaThenTabNameThenColOrder) - .map(pair -> createColumnMeta(pair.getFirst(), pair.getSecond())) - .collect(toCollection(LinkedHashSet::new))); + return schemasAtNow().thenApply(schemas -> + schemas.stream() + .filter(schema -> matches(schema.name(), schemaNameRegex)) + .flatMap(schema -> + Stream.concat( + Arrays.stream(schema.systemViews()) Review Comment: I still don't like using Pair class just because of lack classes hierarchy. It is better to introduce marker interface for that purposes ``` interface CatalogColumnContainer<T> { String name(); List<T> columns(); } ``` This will make streams code clear. Also, this allows to sort tables/views at early stage before unwrapping the columns. -- 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