yuqi1129 commented on code in PR #4262:
URL: https://github.com/apache/gravitino/pull/4262#discussion_r1701085683


##########
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's beyond the scope of this. We cannot determine whether the modified 
value and the old one are the same cluster as judging from the URI is not 
enough, It's the user that is responsible for the change.



-- 
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]

Reply via email to