yuqi1129 commented on code in PR #4262:
URL: https://github.com/apache/gravitino/pull/4262#discussion_r1701095235
##########
catalogs/catalog-hadoop/src/test/java/org/apache/gravitino/catalog/hadoop/integration/test/HadoopCatalogIT.java:
##########
@@ -137,6 +138,29 @@ private static void dropSchema() {
Assertions.assertFalse(catalog.asSchemas().schemaExists(schemaName));
}
+ @Test
+ void testAlterCatalogLocation() {
+ String catalogName =
GravitinoITUtils.genRandomName("test_alter_catalog_location");
+ String location = defaultBaseLocation();
+ String newLocation = location + "/new_location";
+
+ Map<String, String> catalogProperties = ImmutableMap.of("location",
location);
+ // Create a catalog using location
+ Catalog filesetCatalog =
+ metalake.createCatalog(
+ catalogName, Catalog.Type.FILESET, provider, "comment",
catalogProperties);
+
+ Assertions.assertEquals(location,
filesetCatalog.properties().get("location"));
+
+ // Now try to alter the location and change it to `newLocation`.
+ Catalog modifiedCatalog =
+ metalake.alterCatalog(catalogName,
CatalogChange.setProperty("location", newLocation));
+
+ Assertions.assertEquals(newLocation,
modifiedCatalog.properties().get("location"));
Review Comment:
It is not very clear, switching to a new cluster may have problems if we
store audit logs about the old one, for example, both the old cluster and the
new one have a database named `db1`, so we will use the old audit information
when loading database `db1` from the new one.
--
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]