kbendick commented on a change in pull request #3078:
URL: https://github.com/apache/iceberg/pull/3078#discussion_r703781852



##########
File path: core/src/main/java/org/apache/iceberg/jdbc/JdbcClientPool.java
##########
@@ -48,7 +48,12 @@
   protected Connection newClient() {
     try {
       Properties dbProps = new Properties();
-      properties.forEach((key, value) -> 
dbProps.put(key.replace(JdbcCatalog.PROPERTY_PREFIX, ""), value));
+      properties.forEach((key, value) -> {
+        if (key.startsWith(JdbcCatalog.PROPERTY_PREFIX)) {
+          String dbKey = key.replaceFirst("^" + JdbcCatalog.PROPERTY_PREFIX, 
"");

Review comment:
       Nit / non-blocking: Can you possibly abstract this into a utility method 
in maybe a `JdbcCatalogUtil` class or something similar?
   
   The need to iterate over properties, filter the ones that don't match the 
prefix, and then update the keys, is usually pretty common.
   
   EDIT - Maybe a function in `org.apache.iceberg.jdbc.JdbcUtil`
   ```java
     public static Properties propertiesForCatalog(Properties properties, 
String catalogName) { ... }
   ```




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