mchades commented on code in PR #6751:
URL: https://github.com/apache/gravitino/pull/6751#discussion_r2013684070


##########
core/src/main/java/org/apache/gravitino/catalog/PropertiesMetadataHelpers.java:
##########
@@ -54,25 +54,31 @@ public static void validatePropertyForCreate(
             .collect(Collectors.toList());
     Preconditions.checkArgument(
         reservedProperties.isEmpty(),
-        "Properties are reserved and cannot be set: %s",
+        "Properties or properties with a fixed prefix are reserved and cannot 
be set: %s",
         reservedProperties);
 
     List<String> absentProperties =
-        propertiesMetadata.propertyEntries().keySet().stream()
-            .filter(propertiesMetadata::isRequiredProperty)
-            .filter(k -> !properties.containsKey(k))
+        propertiesMetadata.propertyEntries().values().stream()
+            .filter(PropertyEntry::isRequired)
+            .filter(
+                e ->
+                    (!e.isPrefix() && !properties.containsKey(e.getName()))
+                        || (e.isPrefix()
+                            && properties.keySet().stream()
+                                .noneMatch(k -> k.startsWith(e.getName()))))
+            .map(PropertyEntry::getName)
             .collect(Collectors.toList());
     Preconditions.checkArgument(
         absentProperties.isEmpty(),
-        "Properties are required and must be set: %s",
+        "Properties or properties with a fixed prefix are required and must be 
set: %s",

Review Comment:
   To be more accurate, `prefix properties` should be `a property with a fixed 
prefix`, then you can understand the above description well



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