rdblue commented on a change in pull request #4011:
URL: https://github.com/apache/iceberg/pull/4011#discussion_r835956050



##########
File path: core/src/main/java/org/apache/iceberg/util/PropertyUtil.java
##########
@@ -70,4 +73,26 @@ public static String propertyAsString(Map<String, String> 
properties,
     }
     return defaultValue;
   }
+
+  /**
+   * Returns subset of provided map with keys matching the provided prefix. 
Matching is case-sensitive and the matching
+   * prefix is removed from the keys in returned map.
+   *
+   * @param properties input map
+   * @param prefix prefix to choose keys from input map
+   * @return subset of input map with keys starting with provided prefix and 
prefix trimmed out
+   */
+  public static Map<String, String> propertiesWithPrefix(Map<String, String> 
properties,
+                                                         String prefix) {
+    if (properties == null || properties.isEmpty()) {
+      return ImmutableMap.of();
+    }
+
+    Preconditions.checkState(prefix != null, "prefix can't be null.");

Review comment:
       Error messages should begin with capital letters. They also do not end 
with punctuation because it isn't helpful and takes unnecessary space.. Last, 
we don't use contractions and we try to stick to a common structure. This 
should be `Invalid prefix: null`.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to