Accept 1/0 for boolean configuration values #2740
Open
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.
Summary
This PR standardizes boolean parsing across modules so configuration values accept both
true/falseand1/0(withnull/unrecognized values treated as false). This improves compatibility with tools and environments that only emit numeric booleans.Closes
Checklist
Delete items not relevant to your PR:
1and0for boolean properties #2730Note
Medium Risk
Behavior changes for boolean parsing in config and value conversion paths could alter outcomes for previously non-standard string values, though the change is small and well-covered by new tests.
Overview
Standardizes boolean parsing across
clickhouse-data,client-v2, andjdbc-v2by introducingClickHouseUtils.parseBoolean(String)(supportstrue/falseand1/0, defaults tofalsefor null/unknown) and routing existing boolean parsing through it.Updates client config parsing (
ClientConfigProperties.parseValue), string-to-boolean conversions in serialization/value conversion helpers (SerializerUtils,ValueConverters), and JDBC driver flags (JdbcConfiguration) to use the new parser, and adds targeted unit tests covering numeric and textual boolean inputs.Written by Cursor Bugbot for commit 3128606. This will update automatically on new commits. Configure here.