moomindani commented on code in PR #15558:
URL: https://github.com/apache/iceberg/pull/15558#discussion_r2943954093
##########
core/src/test/java/org/apache/iceberg/util/TestPropertyUtil.java:
##########
@@ -25,6 +25,28 @@
public class TestPropertyUtil {
+ @Test
+ void propertiesWithPrefixHandlesRegexSpecialChars() {
+ // prefix[0]. is a valid regex where [0] matches char '0' and . matches
any char,
+ // so replaceFirst would silently fail to strip the literal prefix
"prefix[0]."
+ Map<String, String> properties = Map.of("prefix[0].key", "value");
+
+ Map<String, String> result = PropertyUtil.propertiesWithPrefix(properties,
"prefix[0].");
+
+ assertThat(result).containsExactlyInAnyOrderEntriesOf(Map.of("key",
"value"));
Review Comment:
Done, updated both to use `containsExactly(Map.entry("key", "value"))`.
##########
core/src/test/java/org/apache/iceberg/util/TestPropertyUtil.java:
##########
@@ -25,6 +25,28 @@
public class TestPropertyUtil {
+ @Test
+ void propertiesWithPrefixHandlesRegexSpecialChars() {
+ // prefix[0]. is a valid regex where [0] matches char '0' and . matches
any char,
+ // so replaceFirst would silently fail to strip the literal prefix
"prefix[0]."
Review Comment:
Done, updated both comments to say "replaceFirst (used by the older
propertiesWithPrefix)".
--
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]