You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/09/07 19:43:02 UTC

[GitHub] [iceberg] kbendick commented on a change in pull request #3078: fix: JdbcCatalog jdbc.user is overwrite by user property

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.




-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org