mchades commented on code in PR #6040:
URL: https://github.com/apache/gravitino/pull/6040#discussion_r1899891179
##########
catalogs/catalog-hadoop/src/test/java/org/apache/gravitino/catalog/hadoop/integration/test/HadoopCatalogIT.java:
##########
@@ -301,12 +288,34 @@ public void testExternalFileset() throws IOException {
@Test
void testNameSpec() {
- String illegalName = "/%~?*";
+ String illegalName = "ok/test";
+
+ // test illegal catalog name
+ Exception exception =
+ Assertions.assertThrows(
+ IllegalArgumentException.class,
+ () -> metalake.createCatalog(illegalName, Catalog.Type.FILESET,
provider, null, null));
+ Assertions.assertTrue(exception.getMessage().contains("The catalog name
'ok/test' is illegal"));
+
+ // test illegal schema name
+ exception =
+ Assertions.assertThrows(
+ IllegalArgumentException.class,
+ () -> catalog.asSchemas().createSchema(illegalName, "comment",
null));
+ Assertions.assertTrue(
+ exception.getMessage().contains("does not support '/' in the name for
SCHEMA"));
+ // test illegal fileset name
NameIdentifier nameIdentifier = NameIdentifier.of(schemaName, illegalName);
-
- Assertions.assertThrows(
- NoSuchFilesetException.class, () ->
catalog.asFilesetCatalog().loadFileset(nameIdentifier));
+ exception =
+ Assertions.assertThrows(
+ IllegalArgumentException.class,
+ () ->
+ catalog
+ .asFilesetCatalog()
+ .createFileset(nameIdentifier, null, MANAGED, null, null));
+ Assertions.assertTrue(
+ exception.getMessage().contains("does not support '/' in the name for
FILESET"));
Review Comment:
added
--
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]