danny0405 commented on a change in pull request #1528: [CALCITE-3436] 
CalciteConnectionConfigImpl.set obliterates previous property values
URL: https://github.com/apache/calcite/pull/1528#discussion_r338512397
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/config/CalciteConnectionConfigImpl.java
 ##########
 @@ -40,8 +40,10 @@ public CalciteConnectionConfigImpl(Properties properties) {
   /** Returns a copy of this configuration with one property changed. */
   public CalciteConnectionConfigImpl set(CalciteConnectionProperty property,
       String value) {
-    final Properties properties1 = new Properties(properties);
-    properties1.setProperty(property.camelName(), value);
+    final Properties properties1 = (Properties) this.properties.clone();
+    if (properties1.getProperty(property.camelName()) == null) {
+      properties1.setProperty(property.camelName(), value);
+    }
 
 Review comment:
   Thanks, can you explain why we can not override ? It seems that the defaults 
and the re-set values are the same right ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to