fib-seq 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_r338433179
##########
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:
It's really a hack that I want to fix.
The issue is how `connConfig()` operates in `PlannerImpl.java`, right now we
get a `CalciteConnectionConfig` from `context` and then set the defaults. If
the defaults already exist we don't want to override the configs we get from
`context`
----------------------------------------------------------------
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