mchades commented on code in PR #10874:
URL: https://github.com/apache/gravitino/pull/10874#discussion_r3165174405
##########
catalogs/catalog-jdbc-mysql/src/test/java/org/apache/gravitino/catalog/mysql/integration/test/CatalogMysqlIT.java:
##########
@@ -1893,6 +1893,18 @@ void testNameSpec() {
});
}
+ @Test
+ void testListSchemaWithDotInMysqlUnderlyingDatabaseName() {
+ String schemaWithDot = GravitinoITUtils.genRandomName("db") + ".nested";
+ String sql = String.format("CREATE DATABASE `%s`", schemaWithDot);
+ mysqlService.executeQuery(sql);
+
+ String[] schemas = catalog.asSchemas().listSchemas();
+ Assertions.assertTrue(
+ Arrays.asList(schemas).contains(schemaWithDot),
+ "Schema with dot in MySQL should be listed as logical schema name");
Review Comment:
After my local testing, before this PR, loadSchema would throw an error
(`IllegalArgumentException: If the type is SCHEMA, the length of names must be
2`) caused by `MetadataObjects.of(catalog, schemaDTO.name(),
MetadataObject.Type.SCHEMA)`, while listSchema could run normally.
--
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]