KyleLin0927 commented on code in PR #7238:
URL: https://github.com/apache/gravitino/pull/7238#discussion_r2106524562
##########
catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/HadoopCatalogOperations.java:
##########
@@ -296,6 +296,12 @@ public Fileset createMultipleLocationFileset(
// Either catalog property "location", or schema property "location", or
storageLocation must be
// set for managed fileset.
+ for (Map.Entry<String, String> e : storageLocations.entrySet()) {
+ if (StringUtils.isBlank(e.getValue())) {
+ throw new IllegalArgumentException(
+ "Storage location for name '" + e.getKey() + "' must not be null
or blank");
+ }
+ }
Map<String, Path> schemaPaths =
getAndCheckSchemaPaths(schemaIdent.name(), schemaEntity.properties());
if (schemaPaths.isEmpty() && storageLocations.isEmpty()) {
Review Comment:
You may refer to the unit test I added in this PR
(TestHadoopCatalogOperations.java line 1559) If the storageLocations input
contains both a valid entry and a blank value, it will still trigger an NPE in
calculateFilesetPaths. If you think this test is not appropriate, I will remove
it.
<img width="1400" alt="image"
src="https://github.com/user-attachments/assets/04c2a29c-57ca-449f-b884-18d8d8f3b651"
/>
--
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]