Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#7266] improvement(fileset): polish error message for fileset default location (#8180)

mchades29d42004d967
diff --git a/catalogs/catalog-fileset/src/main/java/org/apache/gravitino/catalog/fileset/FilesetCatalogOperations.java b/catalogs/catalog-fileset/src/main/java/org/apache/gravitino/catalog/fileset/FilesetCatalogOperations.java
index 68297bb7cb..e5f2a1a10a 100644
--- a/catalogs/catalog-fileset/src/main/java/org/apache/gravitino/catalog/fileset/FilesetCatalogOperations.java
+++ b/catalogs/catalog-fileset/src/main/java/org/apache/gravitino/catalog/fileset/FilesetCatalogOperations.java
@@ -558,7 +558,9 @@ public class FilesetCatalogOperations extends ManagedSchemaOperations
&& !properties.isEmpty()
&& properties.containsKey(PROPERTY_DEFAULT_LOCATION_NAME)
&& filesetPaths.containsKey(properties.get(PROPERTY_DEFAULT_LOCATION_NAME)),
- "Default location name must be set and must be one of the fileset locations, "
+ "The fileset property "
+ + PROPERTY_DEFAULT_LOCATION_NAME
+ + " must be set and must be one of the fileset locations, "
+ "location names: "
+ filesetPaths.keySet()
+ ", default location name: "
diff --git a/catalogs/catalog-fileset/src/test/java/org/apache/gravitino/catalog/fileset/TestFilesetCatalogOperations.java b/catalogs/catalog-fileset/src/test/java/org/apache/gravitino/catalog/fileset/TestFilesetCatalogOperations.java
index f44121c9c3..dc28f69bce 100644
--- a/catalogs/catalog-fileset/src/test/java/org/apache/gravitino/catalog/fileset/TestFilesetCatalogOperations.java
+++ b/catalogs/catalog-fileset/src/test/java/org/apache/gravitino/catalog/fileset/TestFilesetCatalogOperations.java
@@ -1807,7 +1807,7 @@ public class TestFilesetCatalogOperations {
exception
.getMessage()
.contains(
- "Default location name must be set and must be one of the fileset locations"),
+ "The fileset property default-location-name must be set and must be one of the fileset locations"),
"Exception message: " + exception.getMessage());
}
}