Skip to content

Commit

Permalink
Source Clickhouse: Fix exception in case password field is not prov…
Browse files Browse the repository at this point in the history
…ided in configuration (#10214)

* Fix exception in case password is not provided for Clickhouse source

Exception while checking connection:
java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.JsonNode.asText()" because the return value of "com.fasterxml.jackson.databind.JsonNode.get(String)" is null

* Update changelog

* Bump version for Source Clickhouse

* Bump version of source-clickhouse-strict-encrypt

* Update version in docs

* correct conflict in docs

* bump connector version

* correct doc

Co-authored-by: Marcos Marx <marcosmarxm@gmail.com>
  • Loading branch information
CrafterKolyan and marcosmarxm committed Feb 16, 2022
1 parent 741e672 commit 22810c3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
Expand Up @@ -16,5 +16,5 @@ ENV APPLICATION source-clickhouse-strict-encrypt

COPY --from=build /airbyte /airbyte

LABEL io.airbyte.version=0.1.5
LABEL io.airbyte.version=0.1.6
LABEL io.airbyte.name=airbyte/source-clickhouse-strict-encrypt
Expand Up @@ -16,5 +16,5 @@ ENV APPLICATION source-clickhouse

COPY --from=build /airbyte /airbyte

LABEL io.airbyte.version=0.1.8
LABEL io.airbyte.version=0.1.9
LABEL io.airbyte.name=airbyte/source-clickhouse
Expand Up @@ -93,11 +93,15 @@ public JsonNode toDatabaseConfig(final JsonNode config) {
jdbcUrl.append("?").append(String.join("&", SSL_PARAMETERS));
}

return Jsons.jsonNode(ImmutableMap.builder()
.put("username", config.get("username").asText())
.put("password", config.get("password").asText())
.put("jdbc_url", jdbcUrl.toString())
.build());
ImmutableMap.Builder<Object, Object> configBuilder = ImmutableMap.builder()
.put("username", config.get("username").asText())
.put("jdbc_url", jdbcUrl.toString());

if (config.has("password")) {
configBuilder.put("password", config.get("password").asText());
}

return Jsons.jsonNode(configBuilder.build());
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions docs/integrations/sources/clickhouse.md
Expand Up @@ -78,6 +78,7 @@ Using this feature requires additional configuration, when creating the source.

| Version | Date | Pull Request | Subject |
|:--------| :--- |:---------------------------------------------------------|:-----------------------------------------------------------------|
| 0.1.9 | 2022-02-09 | [\#10214](https://github.com/airbytehq/airbyte/pull/10214) | Fix exception in case `password` field is not provided |
| 0.1.8 | 2022-02-14 | [10256](https://github.com/airbytehq/airbyte/pull/10256) | Add `-XX:+ExitOnOutOfMemoryError` JVM option |
| 0.1.7 | 2021-12-24 | [\#8958](https://github.com/airbytehq/airbyte/pull/8958) | Add support for JdbcType.ARRAY |
| 0.1.6 | 2021-12-15 | [\#8429](https://github.com/airbytehq/airbyte/pull/8429) | Update titles and descriptions |
Expand All @@ -91,6 +92,7 @@ Using this feature requires additional configuration, when creating the source.

| Version | Date | Pull Request | Subject |
|:---| :--- |:---------------------------------------------------------|:---------------------------------------------------------------------------|
| 0.1.6 | 2022-02-09 | [\#10214](https://github.com/airbytehq/airbyte/pull/10214) | Fix exception in case `password` field is not provided |
| 0.1.5 | 2022-02-14 | [10256](https://github.com/airbytehq/airbyte/pull/10256) | Add `-XX:+ExitOnOutOfMemoryError` JVM option |
| 0.1.3 | 2021-12-29 | [\#9182](https://github.com/airbytehq/airbyte/pull/9182) [\#8958](https://github.com/airbytehq/airbyte/pull/8958) | Add support for JdbcType.ARRAY. Fixed tests |
| 0.1.2 | 2021-12-01 | [\#8371](https://github.com/airbytehq/airbyte/pull/8371) | Fixed incorrect handling "\n" in ssh key |
Expand Down

0 comments on commit 22810c3

Please sign in to comment.