moomindani commented on code in PR #15558:
URL: https://github.com/apache/iceberg/pull/15558#discussion_r2922457741


##########
parquet/src/test/java/org/apache/iceberg/parquet/TestParquet.java:
##########
@@ -269,6 +269,54 @@ public void testColumnStatisticsEnabled() throws Exception 
{
     }
   }
 
+  @Test
+  public void testMultipleColumnsStatisticsDisabled() throws Exception {

Review Comment:
   Removed this test. Added two tests to `TestPropertyUtil` instead — one with 
dot-containing prefixes, and one with regex-special characters (`[`) that would 
throw `PatternSyntaxException` with the old `replaceFirst` code.



##########
core/src/main/java/org/apache/iceberg/util/PropertyUtil.java:
##########
@@ -168,7 +168,9 @@ public static Map<String, String> propertiesWithPrefix(
 
     return properties.entrySet().stream()
         .filter(e -> e.getKey().startsWith(prefix))
-        .collect(Collectors.toMap(e -> e.getKey().replaceFirst(prefix, ""), 
Map.Entry::getValue));
+        .collect(
+            Collectors.toMap(
+                e -> e.getKey().substring(prefix.length()), 
Map.Entry::getValue));

Review Comment:
   Done, added `propertiesWithPrefixStripsLiterally` and 
`propertiesWithPrefixHandlesRegexSpecialChars` to `TestPropertyUtil`. The 
latter fails with the old `replaceFirst` code due to `PatternSyntaxException`.



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