ygerzhedovich commented on code in PR #6011: URL: https://github.com/apache/ignite-3/pull/6011#discussion_r2139966831
########## modules/jdbc/src/integrationTest/java/org/apache/ignite/internal/jdbc/ItJdbcMetadataSelfTest.java: ########## @@ -60,11 +57,17 @@ public class ItJdbcMetadataSelfTest extends AbstractJdbcSelfTest { @BeforeAll public static void createTables() throws SQLException { try (Statement stmt = conn.createStatement()) { - stmt.executeUpdate("CREATE TABLE person(name VARCHAR, age INT, orgid INT PRIMARY KEY)"); - stmt.executeUpdate("INSERT INTO person (orgid, name, age) VALUES (1, '111', 111)"); - - stmt.executeUpdate("CREATE TABLE organization(id INT PRIMARY KEY, name VARCHAR, bigdata DECIMAL(20, 10))"); - stmt.executeUpdate("INSERT INTO organization (id, name, bigdata) VALUES (1, 'AAA', 10)"); + stmt.execute("CREATE SCHEMA IF NOT EXISTS PUBLIC;" + + "CREATE SCHEMA IF NOT EXISTS META;" + + "CREATE SCHEMA IF NOT EXISTS USER2;" + + "CREATE SCHEMA IF NOT EXISTS USER1;" + + "CREATE TABLE person(name VARCHAR(32), age INT, orgid INT PRIMARY KEY);" + + "CREATE TABLE organization(id INT PRIMARY KEY, name VARCHAR, bigdata DECIMAL(20, 10));" Review Comment: I think it will be good to add/amend one of them to casesensetive ########## modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/jdbc/JdbcMetadataCatalog.java: ########## @@ -133,21 +147,22 @@ public CompletableFuture<List<JdbcTableMeta>> getTablesMeta(String schemaNamePtr 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()); - }); - } - - private static boolean tableNameAndSchemaMatches( - CatalogTableDescriptor table, - @Nullable String schemaNameRegex, - @Nullable String tlbNameRegex - ) { - return matches(SqlCommon.DEFAULT_SCHEMA_NAME, schemaNameRegex) && matches(table.name(), tlbNameRegex); + return schemasAtNow().thenApply(schemas -> + schemas.stream() + .filter(schema -> matches(schema.name(), schemaNameRegex)) + .flatMap(schema -> + Stream.concat( + Arrays.stream(schema.systemViews()) Review Comment: seems ``tblTypes`` should be taking into account ########## modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/jdbc/JdbcMetadataCatalog.java: ########## @@ -211,30 +230,31 @@ public CompletableFuture<Collection<String>> getSchemasMeta(String schemaNamePtr * @param tbl Table. * @return Jdbc primary key metadata. */ - private JdbcPrimaryKeyMeta createPrimaryKeyMeta(CatalogTableDescriptor tbl) { + private static JdbcPrimaryKeyMeta createPrimaryKeyMeta(String schemaName, CatalogTableDescriptor tbl) { String keyName = PK + tbl.name(); Review Comment: we don't have a name for PK, maybe ``null`` is right value here -- 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