forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'StevenReitsma/feature/clickhouse-cluste…
…r-support'
- Loading branch information
Showing
12 changed files
with
439 additions
and
53 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
22 changes: 22 additions & 0 deletions
22
...main/java/io/airbyte/integrations/destination/clickhouse/ClickhouseDestinationConfig.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.integrations.destination.clickhouse; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
|
||
// This configuration class does not include the default JDBC configuration parameters. | ||
public record ClickhouseDestinationConfig(String engine, | ||
ClickhouseDestinationDeployTypeConfig deploy_config) { | ||
|
||
public final static String DEFAULT_ENGINE = "MergeTree"; | ||
|
||
public static ClickhouseDestinationConfig get(final JsonNode config) { | ||
return new ClickhouseDestinationConfig( | ||
config.has("engine") ? config.get("engine").asText() : DEFAULT_ENGINE, | ||
config.has("deploy_type") ? ClickhouseDestinationDeployTypeConfig.get(config.get("deploy_type")) | ||
: ClickhouseDestinationDeployTypeConfig.defaultConfig()); | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
...io/airbyte/integrations/destination/clickhouse/ClickhouseDestinationDeployTypeConfig.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.integrations.destination.clickhouse; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
|
||
public record ClickhouseDestinationDeployTypeConfig(String type, String cluster, boolean replication) { | ||
|
||
public static final String DEFAULT_DEPLOY_TYPE = "clickhouse-cloud"; | ||
public static final String DEFAULT_CLUSTER_NAME = "default"; | ||
public static final boolean DEFAULT_REPLICATION = false; | ||
|
||
public static ClickhouseDestinationDeployTypeConfig get(final JsonNode config) { | ||
return new ClickhouseDestinationDeployTypeConfig( | ||
config.has("deploy_type") ? config.get("deploy_type").asText() : DEFAULT_DEPLOY_TYPE, | ||
config.has("cluster") ? config.get("cluster").asText() : DEFAULT_CLUSTER_NAME, | ||
config.has("replication") ? config.get("replication").asBoolean() : DEFAULT_REPLICATION); | ||
} | ||
|
||
public static ClickhouseDestinationDeployTypeConfig defaultConfig() { | ||
return new ClickhouseDestinationDeployTypeConfig(DEFAULT_DEPLOY_TYPE, DEFAULT_CLUSTER_NAME, | ||
DEFAULT_REPLICATION); | ||
} | ||
|
||
} |
Oops, something went wrong.