Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mkhokh/8858 cursor fields for incremental update #14356

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
1087ac2
add logic to skip incremental mode for tables which do not have a fie…
mkhokh-33 Jun 21, 2022
3f9f77a
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jun 30, 2022
a9e676c
added tests for cursor fields incremental updates
mkhokh-33 Jul 1, 2022
c995745
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 1, 2022
e3bdd08
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 1, 2022
c17eb5e
remove not used methods
mkhokh-33 Jul 4, 2022
c55f15d
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 4, 2022
656cfaf
fix tests
mkhokh-33 Jul 7, 2022
9c0a4a5
Merge remote-tracking branch 'origin/mkhokh/8858-cursor-fields-for-in…
mkhokh-33 Jul 7, 2022
0b1c4db
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 7, 2022
6222fe5
fix formatting
mkhokh-33 Jul 7, 2022
b9d022c
revert RedshiftInsertDestinationAcceptanceTest
mkhokh-33 Jul 7, 2022
290675d
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 7, 2022
85dd5fd
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 7, 2022
59123e9
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 8, 2022
9661786
fix ssl clickhouse test
mkhokh-33 Jul 11, 2022
144ff79
fix codereview comments
mkhokh-33 Jul 14, 2022
42c08c7
fix clickhouse strict encrypt test
mkhokh-33 Jul 15, 2022
4c01d83
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 15, 2022
3e3dc1a
fix postgres source after merge from master
mkhokh-33 Jul 15, 2022
dd50380
optimize ssl clickhouse test logic
mkhokh-33 Jul 15, 2022
88be4d0
fix db2 test
mkhokh-33 Jul 18, 2022
6f5976e
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 19, 2022
71b74b1
added check for cursor field should be not nullable, fix formatting
mkhokh-33 Jul 21, 2022
e7debd6
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 21, 2022
4ce08b7
fixed tests, formatting, issue after merge from master
mkhokh-33 Jul 22, 2022
64876a9
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 22, 2022
0627a00
fix merge issues
mkhokh-33 Jul 22, 2022
cdb2c2a
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 24, 2022
e09b9ff
fix test for source-jdbc and remove some code used for local testing
mkhokh-33 Jul 24, 2022
7615ab9
added description for cockroach db tests
mkhokh-33 Jul 26, 2022
917829a
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 26, 2022
46b5c4f
test changes
mkhokh-33 Jul 26, 2022
106852e
refactoring for cursor field tests after code review comments
mkhokh-33 Jul 26, 2022
ccabf73
refactoring for cursor field tests after code review comments
mkhokh-33 Jul 26, 2022
254608a
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 27, 2022
7755b29
fix code review comments
mkhokh-33 Jul 27, 2022
07ac353
remove unused imports
mkhokh-33 Jul 27, 2022
947db87
fix formatting
mkhokh-33 Jul 27, 2022
578afa9
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 27, 2022
bec5fab
fix compilation error
mkhokh-33 Jul 28, 2022
fa61c88
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 28, 2022
b834449
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Jul 28, 2022
c203eca
fix postgres and postgress ssl test
mkhokh-33 Jul 28, 2022
979fe1f
Fixed bucket naming for S3
VitaliiMaltsev Aug 1, 2022
7d2963a
Merge branch 'master' of https://github.com/airbytehq/airbyte
VitaliiMaltsev Aug 1, 2022
c07fe87
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Aug 2, 2022
e921180
Merge branch 'master' of https://github.com/airbytehq/airbyte
VitaliiMaltsev Aug 2, 2022
92ac1c8
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Aug 3, 2022
9d13b6a
remove CHAR, NCHAR from possible cursor types
mkhokh-33 Aug 3, 2022
4e1eb53
remove SYMBOL from possible cursor types
mkhokh-33 Aug 3, 2022
dd8fb96
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
mkhokh-33 Aug 3, 2022
0e6f7df
Merge branch 'master' of https://github.com/airbytehq/airbyte
VitaliiMaltsev Aug 7, 2022
7924657
Merge branch 'master' of https://github.com/airbytehq/airbyte
VitaliiMaltsev Aug 8, 2022
b5c1106
Merge branch 'master' of https://github.com/airbytehq/airbyte
VitaliiMaltsev Aug 10, 2022
fc34cfb
Merge branch 'master' of https://github.com/airbytehq/airbyte
VitaliiMaltsev Aug 11, 2022
8ae35a5
Merge branch 'master' of https://github.com/airbytehq/airbyte
VitaliiMaltsev Aug 11, 2022
e5e1d12
Merge branch 'master' of https://github.com/airbytehq/airbyte
VitaliiMaltsev Aug 11, 2022
f003cc6
Merge branch 'master' of https://github.com/airbytehq/airbyte
VitaliiMaltsev Aug 15, 2022
a526c81
Merge branch 'master' of https://github.com/airbytehq/airbyte
VitaliiMaltsev Aug 15, 2022
01c0dfd
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
VitaliiMaltsev Aug 15, 2022
926753e
removed redundant configs
VitaliiMaltsev Aug 15, 2022
ad45e4f
fixed mysql-strict-encrypt tests
VitaliiMaltsev Aug 15, 2022
1fa465a
fixed mongodb-v2 tests
VitaliiMaltsev Aug 16, 2022
b9a4c3d
Merge branch 'master' of https://github.com/airbytehq/airbyte
VitaliiMaltsev Aug 17, 2022
803ae8c
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
VitaliiMaltsev Aug 17, 2022
7709310
Merge branch 'master' into mkhokh/8858-cursor-fields-for-incremental-…
subodh1810 Aug 18, 2022
0859fc4
minor format changes
subodh1810 Aug 18, 2022
6c58d33
bump version
VitaliiMaltsev Aug 18, 2022
b645d33
Merge remote-tracking branch 'origin/mkhokh/8858-cursor-fields-for-in…
VitaliiMaltsev Aug 18, 2022
4950c6f
auto-bump connector version [ci skip]
octavia-squidington-iii Aug 18, 2022
ab199ff
auto-bump connector version [ci skip]
octavia-squidington-iii Aug 18, 2022
1e29074
Merge branch 'mkhokh/8858-cursor-fields-for-incremental-update' of ht…
octavia-squidington-iii Aug 18, 2022
aa00dc8
auto-bump connector version [ci skip]
octavia-squidington-iii Aug 18, 2022
8ce2093
Merge branch 'mkhokh/8858-cursor-fields-for-incremental-update' of ht…
octavia-squidington-iii Aug 18, 2022
d466cd7
auto-bump connector version [ci skip]
octavia-squidington-iii Aug 18, 2022
8361768
Merge branch 'mkhokh/8858-cursor-fields-for-incremental-update' of ht…
octavia-squidington-iii Aug 18, 2022
1b63d3e
auto-bump connector version [ci skip]
octavia-squidington-iii Aug 18, 2022
8e7fb6f
Merge branch 'mkhokh/8858-cursor-fields-for-incremental-update' of ht…
octavia-squidington-iii Aug 18, 2022
a38412b
auto-bump connector version [ci skip]
octavia-squidington-iii Aug 18, 2022
ba541c3
Merge branch 'mkhokh/8858-cursor-fields-for-incremental-update' of ht…
octavia-squidington-iii Aug 18, 2022
011bbb9
auto-bump connector version [ci skip]
octavia-squidington-iii Aug 18, 2022
a89a60d
Merge branch 'mkhokh/8858-cursor-fields-for-incremental-update' of ht…
octavia-squidington-iii Aug 18, 2022
766ed22
auto-bump connector version [ci skip]
octavia-squidington-iii Aug 18, 2022
f0af86e
Merge branch 'mkhokh/8858-cursor-fields-for-incremental-update' of ht…
octavia-squidington-iii Aug 18, 2022
fd29203
auto-bump connector version [ci skip]
octavia-squidington-iii Aug 18, 2022
a7ca3db
Merge branch 'mkhokh/8858-cursor-fields-for-incremental-update' of ht…
octavia-squidington-iii Aug 18, 2022
8832697
auto-bump connector version [ci skip]
octavia-squidington-iii Aug 18, 2022
94e5302
Merge branch 'mkhokh/8858-cursor-fields-for-incremental-update' of ht…
octavia-squidington-iii Aug 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions airbyte-config/init/src/main/resources/seed/source_definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
- name: ClickHouse
sourceDefinitionId: bad83517-5e54-4a3d-9b53-63e85fbd4d7c
dockerRepository: airbyte/source-clickhouse
dockerImageTag: 0.1.11
dockerImageTag: 0.1.12
documentationUrl: https://docs.airbyte.io/integrations/sources/clickhouse
icon: cliskhouse.svg
sourceType: database
Expand All @@ -176,7 +176,7 @@
- name: Cockroachdb
sourceDefinitionId: 9fa5862c-da7c-11eb-8d19-0242ac130003
dockerRepository: airbyte/source-cockroachdb
dockerImageTag: 0.1.15
dockerImageTag: 0.1.16
documentationUrl: https://docs.airbyte.io/integrations/sources/cockroachdb
icon: cockroachdb.svg
sourceType: database
Expand Down Expand Up @@ -449,7 +449,7 @@
- name: IBM Db2
sourceDefinitionId: 447e0381-3780-4b46-bb62-00a4e3c8b8e2
dockerRepository: airbyte/source-db2
dockerImageTag: 0.1.13
dockerImageTag: 0.1.14
documentationUrl: https://docs.airbyte.io/integrations/sources/db2
icon: db2.svg
sourceType: database
Expand Down Expand Up @@ -599,7 +599,7 @@
- name: Microsoft SQL Server (MSSQL)
sourceDefinitionId: b5ea17b1-f170-46dc-bc31-cc744ca984c1
dockerRepository: airbyte/source-mssql
dockerImageTag: 0.4.15
dockerImageTag: 0.4.16
documentationUrl: https://docs.airbyte.io/integrations/sources/mssql
icon: mssql.svg
sourceType: database
Expand Down Expand Up @@ -631,7 +631,7 @@
- name: MongoDb
sourceDefinitionId: b2e713cd-cc36-4c0a-b5bd-b47cb8a0561e
dockerRepository: airbyte/source-mongodb-v2
dockerImageTag: 0.1.15
dockerImageTag: 0.1.16
documentationUrl: https://docs.airbyte.io/integrations/sources/mongodb-v2
icon: mongodb.svg
sourceType: database
Expand All @@ -647,7 +647,7 @@
- name: MySQL
sourceDefinitionId: 435bb9a5-7887-4809-aa58-28c27df0d7ad
dockerRepository: airbyte/source-mysql
dockerImageTag: 0.6.3
dockerImageTag: 0.6.4
documentationUrl: https://docs.airbyte.io/integrations/sources/mysql
icon: mysql.svg
sourceType: database
Expand Down Expand Up @@ -686,7 +686,7 @@
- name: Oracle DB
sourceDefinitionId: b39a7370-74c3-45a6-ac3a-380d48520a83
dockerRepository: airbyte/source-oracle
dockerImageTag: 0.3.19
dockerImageTag: 0.3.20
documentationUrl: https://docs.airbyte.io/integrations/sources/oracle
icon: oracle.svg
sourceType: database
Expand Down Expand Up @@ -797,7 +797,7 @@
- name: Postgres
sourceDefinitionId: decd338e-5647-4c0b-adf4-da0e75f5a750
dockerRepository: airbyte/source-postgres
dockerImageTag: 1.0.2
dockerImageTag: 1.0.3
documentationUrl: https://docs.airbyte.io/integrations/sources/postgres
icon: postgresql.svg
sourceType: database
Expand Down Expand Up @@ -845,7 +845,7 @@
- name: Redshift
sourceDefinitionId: e87ffa8e-a3b5-f69c-9076-6011339de1f6
dockerRepository: airbyte/source-redshift
dockerImageTag: 0.3.11
dockerImageTag: 0.3.12
documentationUrl: https://docs.airbyte.io/integrations/sources/redshift
icon: redshift.svg
sourceType: database
Expand Down Expand Up @@ -948,7 +948,7 @@
- name: Snowflake
sourceDefinitionId: e2d65910-8c8b-40a1-ae7d-ee2416b2bfa2
dockerRepository: airbyte/source-snowflake
dockerImageTag: 0.1.17
dockerImageTag: 0.1.18
documentationUrl: https://docs.airbyte.io/integrations/sources/snowflake
icon: snowflake.svg
sourceType: database
Expand Down
20 changes: 10 additions & 10 deletions airbyte-config/init/src/main/resources/seed/source_specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-clickhouse:0.1.11"
- dockerImage: "airbyte/source-clickhouse:0.1.12"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/destinations/clickhouse"
connectionSpecification:
Expand Down Expand Up @@ -1390,7 +1390,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-cockroachdb:0.1.15"
- dockerImage: "airbyte/source-cockroachdb:0.1.16"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/cockroachdb"
connectionSpecification:
Expand Down Expand Up @@ -4016,7 +4016,7 @@
- - "client_secret"
oauthFlowOutputParameters:
- - "refresh_token"
- dockerImage: "airbyte/source-db2:0.1.13"
- dockerImage: "airbyte/source-db2:0.1.14"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/db2"
connectionSpecification:
Expand Down Expand Up @@ -5271,7 +5271,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-mssql:0.4.15"
- dockerImage: "airbyte/source-mssql:0.4.16"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/destinations/mssql"
connectionSpecification:
Expand Down Expand Up @@ -5882,7 +5882,7 @@
path_in_connector_config:
- "credentials"
- "client_secret"
- dockerImage: "airbyte/source-mongodb-v2:0.1.15"
- dockerImage: "airbyte/source-mongodb-v2:0.1.16"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/mongodb-v2"
changelogUrl: "https://docs.airbyte.io/integrations/sources/mongodb-v2"
Expand Down Expand Up @@ -6046,7 +6046,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-mysql:0.6.3"
- dockerImage: "airbyte/source-mysql:0.6.4"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/mysql"
connectionSpecification:
Expand Down Expand Up @@ -6708,7 +6708,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-oracle:0.3.19"
- dockerImage: "airbyte/source-oracle:0.3.20"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/oracle"
connectionSpecification:
Expand Down Expand Up @@ -7545,7 +7545,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-postgres:1.0.2"
- dockerImage: "airbyte/source-postgres:1.0.3"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/postgres"
connectionSpecification:
Expand Down Expand Up @@ -8145,7 +8145,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-redshift:0.3.11"
- dockerImage: "airbyte/source-redshift:0.3.12"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/destinations/redshift"
connectionSpecification:
Expand Down Expand Up @@ -9319,7 +9319,7 @@
- - "client_secret"
oauthFlowOutputParameters:
- - "refresh_token"
- dockerImage: "airbyte/source-snowflake:0.1.17"
- dockerImage: "airbyte/source-snowflake:0.1.18"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/snowflake"
connectionSpecification:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,12 @@ void setStatementField(final PreparedStatement preparedStatement,
*/
String getFullyQualifiedTableNameWithQuoting(final Connection connection, final String schemaName, final String tableName) throws SQLException;

/**
* This method will verify that filed could be used as cursor for incremental sync
*
* @param type - table field type that should be checked
* @return true is field type can be used as cursor field for incremental sync
*/
boolean isCursorType(final SourceType type);

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ public final class JdbcConstants {
public static final String JDBC_COLUMN_DATA_TYPE = "DATA_TYPE";
public static final String JDBC_COLUMN_TYPE_NAME = "TYPE_NAME";
public static final String JDBC_COLUMN_SIZE = "COLUMN_SIZE";
public static final String JDBC_IS_NULLABLE = "IS_NULLABLE";

public static final String INTERNAL_SCHEMA_NAME = "schemaName";
public static final String INTERNAL_TABLE_NAME = "tableName";
public static final String INTERNAL_COLUMN_NAME = "columnName";
public static final String INTERNAL_COLUMN_TYPE = "columnType";
public static final String INTERNAL_COLUMN_TYPE_NAME = "columnTypeName";
public static final String INTERNAL_COLUMN_SIZE = "columnSize";
public static final String INTERNAL_IS_NULLABLE = "isNullable";

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import static io.airbyte.db.jdbc.JdbcConstants.INTERNAL_COLUMN_TYPE;
import static io.airbyte.db.jdbc.JdbcConstants.INTERNAL_SCHEMA_NAME;
import static io.airbyte.db.jdbc.JdbcConstants.INTERNAL_TABLE_NAME;
import static io.airbyte.db.jdbc.JdbcUtils.ALLOWED_CURSOR_TYPES;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
Expand Down Expand Up @@ -101,6 +102,11 @@ public JDBCType getFieldType(final JsonNode field) {
}
}

@Override
public boolean isCursorType(JDBCType type) {
return ALLOWED_CURSOR_TYPES.contains(type);
}

@Override
public JsonSchemaType getJsonType(final JDBCType jdbcType) {
return switch (jdbcType) {
Expand Down
20 changes: 20 additions & 0 deletions airbyte-db/db-lib/src/main/java/io/airbyte/db/jdbc/JdbcUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,29 @@

package io.airbyte.db.jdbc;

import static java.sql.JDBCType.BIGINT;
import static java.sql.JDBCType.DATE;
import static java.sql.JDBCType.DECIMAL;
import static java.sql.JDBCType.DOUBLE;
import static java.sql.JDBCType.FLOAT;
import static java.sql.JDBCType.INTEGER;
import static java.sql.JDBCType.LONGVARCHAR;
import static java.sql.JDBCType.NUMERIC;
import static java.sql.JDBCType.NVARCHAR;
import static java.sql.JDBCType.REAL;
import static java.sql.JDBCType.SMALLINT;
import static java.sql.JDBCType.TIME;
import static java.sql.JDBCType.TIMESTAMP;
import static java.sql.JDBCType.TINYINT;
import static java.sql.JDBCType.VARCHAR;

import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.collect.Maps;
import java.sql.JDBCType;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.jooq.JSONFormat;

public class JdbcUtils {
Expand All @@ -34,6 +52,8 @@ public class JdbcUtils {
public static final String USERNAME_KEY = "username";
public static final String MODE_KEY = "mode";
public static final String AMPERSAND = "&";
public static final Set<JDBCType> ALLOWED_CURSOR_TYPES = Set.of(TIMESTAMP, TIME, DATE, TINYINT, SMALLINT, INTEGER,
BIGINT, FLOAT, DOUBLE, REAL, NUMERIC, DECIMAL, NVARCHAR, VARCHAR, LONGVARCHAR);
private static final JdbcSourceOperations defaultSourceOperations = new JdbcSourceOperations();

private static final JSONFormat defaultJSONFormat = new JSONFormat().recordFormat(JSONFormat.RecordFormat.OBJECT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ ENV APPLICATION source-clickhouse-strict-encrypt

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-strict-encrypt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ public String createTableQuery(final String tableName,

@BeforeAll
static void init() {
CREATE_TABLE_WITHOUT_CURSOR_TYPE_QUERY = "CREATE TABLE %s (%s Array(UInt32)) ENGINE = MergeTree ORDER BY tuple();";
INSERT_TABLE_WITHOUT_CURSOR_TYPE_QUERY = "INSERT INTO %s VALUES([12, 13, 0, 1]);)";
CREATE_TABLE_WITH_NULLABLE_CURSOR_TYPE_QUERY = "CREATE TABLE %s (%s Nullable(VARCHAR(20))) ENGINE = MergeTree ORDER BY tuple();";
INSERT_TABLE_WITH_NULLABLE_CURSOR_TYPE_QUERY = "INSERT INTO %s VALUES('Hello world :)');";

container = new GenericContainer<>(new ImageFromDockerfile("clickhouse-test")
.withFileFromClasspath("Dockerfile", "docker/Dockerfile")
.withFileFromClasspath("clickhouse_certs.sh", "docker/clickhouse_certs.sh"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ ENV APPLICATION source-clickhouse

COPY --from=build /airbyte /airbyte

LABEL io.airbyte.version=0.1.11
LABEL io.airbyte.version=0.1.12
LABEL io.airbyte.name=airbyte/source-clickhouse
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.time.Duration;
import java.util.List;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.testcontainers.containers.ClickHouseContainer;
import org.testcontainers.containers.wait.strategy.Wait;
Expand Down Expand Up @@ -54,6 +55,14 @@ public String createTableQuery(final String tableName, final String columnClause
+ primaryKeyClause);
}

@BeforeAll
static void init() {
CREATE_TABLE_WITHOUT_CURSOR_TYPE_QUERY = "CREATE TABLE %s (%s Array(UInt32)) ENGINE = MergeTree ORDER BY tuple();";
INSERT_TABLE_WITHOUT_CURSOR_TYPE_QUERY = "INSERT INTO %s VALUES([12, 13, 0, 1]);)";
CREATE_TABLE_WITH_NULLABLE_CURSOR_TYPE_QUERY = "CREATE TABLE %s (%s Nullable(VARCHAR(20))) ENGINE = MergeTree ORDER BY tuple();";
INSERT_TABLE_WITH_NULLABLE_CURSOR_TYPE_QUERY = "INSERT INTO %s VALUES('Hello world :)');";
}

@Override
@AfterEach
public void tearDown() throws SQLException {
Expand Down
Loading