[CALCITE-3436] CalciteConnectionConfigImpl.set obliterates previous property values#1528
Closed
fib-seq wants to merge 3 commits intoapache:masterfrom
Closed
[CALCITE-3436] CalciteConnectionConfigImpl.set obliterates previous property values#1528fib-seq wants to merge 3 commits intoapache:masterfrom
fib-seq wants to merge 3 commits intoapache:masterfrom
Conversation
danny0405
reviewed
Oct 24, 2019
| final Properties properties1 = (Properties) this.properties.clone(); | ||
| if (properties1.getProperty(property.camelName()) == null) { | ||
| properties1.setProperty(property.camelName(), value); | ||
| } |
Contributor
There was a problem hiding this comment.
Why we set the property when the original value is null ?
Contributor
Author
There was a problem hiding this 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
Contributor
There was a problem hiding this comment.
Thanks, can you explain why we can not override ? It seems that the defaults and the re-set values are the same right ?
julianhyde
pushed a commit
to julianhyde/calcite
that referenced
this pull request
Oct 24, 2019
…thods (Ryan Fu) The 'isSet' method allows Planner to set "conformance" and "caseSensitive" connection properties based on the parser configuration only if they have not been explicitly set in the connection properties. In PlannerImpl, store 'costFactory' and no longer store 'frameworkConfig'; it might prevent memory leaks. Close apache#1528
XuQianJin-Stars
pushed a commit
to XuQianJin-Stars/calcite
that referenced
this pull request
Nov 17, 2019
…thods (Ryan Fu) The 'isSet' method allows Planner to set "conformance" and "caseSensitive" connection properties based on the parser configuration only if they have not been explicitly set in the connection properties. In PlannerImpl, store 'costFactory' and no longer store 'frameworkConfig'; it might prevent memory leaks. Close apache#1528
XuQianJin-Stars
pushed a commit
to XuQianJin-Stars/calcite
that referenced
this pull request
Nov 20, 2019
…thods (Ryan Fu) The 'isSet' method allows Planner to set "conformance" and "caseSensitive" connection properties based on the parser configuration only if they have not been explicitly set in the connection properties. In PlannerImpl, store 'costFactory' and no longer store 'frameworkConfig'; it might prevent memory leaks. Close apache#1528
XuQianJin-Stars
pushed a commit
to XuQianJin-Stars/calcite
that referenced
this pull request
Nov 20, 2019
…thods (Ryan Fu) The 'isSet' method allows Planner to set "conformance" and "caseSensitive" connection properties based on the parser configuration only if they have not been explicitly set in the connection properties. In PlannerImpl, store 'costFactory' and no longer store 'frameworkConfig'; it might prevent memory leaks. Close apache#1528
wangxlong
pushed a commit
to wangxlong/calcite
that referenced
this pull request
Feb 13, 2020
…thods (Ryan Fu) The 'isSet' method allows Planner to set "conformance" and "caseSensitive" connection properties based on the parser configuration only if they have not been explicitly set in the connection properties. In PlannerImpl, store 'costFactory' and no longer store 'frameworkConfig'; it might prevent memory leaks. Close apache#1528
jamesstarr
pushed a commit
to jamesstarr/calcite
that referenced
this pull request
Aug 28, 2025
…thods (Ryan Fu) The 'isSet' method allows Planner to set "conformance" and "caseSensitive" connection properties based on the parser configuration only if they have not been explicitly set in the connection properties. In PlannerImpl, store 'costFactory' and no longer store 'frameworkConfig'; it might prevent memory leaks. Close apache#1528 Change-Id: I53b7626845a753ed1d9539f8597166124b382b44
jamesstarr
pushed a commit
to jamesstarr/calcite
that referenced
this pull request
Mar 16, 2026
…thods (Ryan Fu) The 'isSet' method allows Planner to set "conformance" and "caseSensitive" connection properties based on the parser configuration only if they have not been explicitly set in the connection properties. In PlannerImpl, store 'costFactory' and no longer store 'frameworkConfig'; it might prevent memory leaks. Close apache#1528 Change-Id: I53b7626845a753ed1d9539f8597166124b382b44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolved issue where if context was passed a CalciteConnectionConfig, it would not set the default CalciteConnectionConfig settings.
I introduced a few tests that checks for if the values will get obliterated upon calling CalciteConnectionConfigImpl.set(). Upon further inspection, when creating a new Properties object with properties argument, these will be stored in a defaults field. To return a copy of the config without having it set in the defaults field I cloned the properties field instead.
Lastly, refactored the
frameworkConfig.getCostFactory()method into the fieldcostFactory