Skip to content

Commit 1d66672

Browse files
🐛 Fixed cursor for old connectors that use non-microsecond format. Now connectors work with both formats (#10508)
* updated timestamp transformation with microseconds * updated timestamp transformation with microseconds * updated mysql datatype tests * updated mysql datatype tests * updated mysql datatype tests * updated mysql datatype tests * updated mysql datatype tests * updated mysql tests * removed extra logs * fixed cursor for timestamp * updated test * updated type transformation * updated type transformation * updated type transformation * updated tests * updated oracle tests * updated documentations and connectors versions * updated documentations and connectors versions * fix code style * updated cursor for jdbc sources * updated cursor for jdbc sources * updated cursor for jdbc sources
1 parent 303d103 commit 1d66672

File tree

23 files changed

+47
-31
lines changed

23 files changed

+47
-31
lines changed

airbyte-config/init/src/main/resources/seed/source_definitions.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
- name: Cockroachdb
141141
sourceDefinitionId: 9fa5862c-da7c-11eb-8d19-0242ac130003
142142
dockerRepository: airbyte/source-cockroachdb
143-
dockerImageTag: 0.1.8
143+
dockerImageTag: 0.1.9
144144
documentationUrl: https://docs.airbyte.io/integrations/sources/cockroachdb
145145
icon: cockroachdb.svg
146146
sourceType: database
@@ -335,7 +335,7 @@
335335
- name: IBM Db2
336336
sourceDefinitionId: 447e0381-3780-4b46-bb62-00a4e3c8b8e2
337337
dockerRepository: airbyte/source-db2
338-
dockerImageTag: 0.1.8
338+
dockerImageTag: 0.1.9
339339
documentationUrl: https://docs.airbyte.io/integrations/sources/db2
340340
icon: db2.svg
341341
sourceType: database
@@ -446,7 +446,7 @@
446446
- name: Microsoft SQL Server (MSSQL)
447447
sourceDefinitionId: b5ea17b1-f170-46dc-bc31-cc744ca984c1
448448
dockerRepository: airbyte/source-mssql
449-
dockerImageTag: 0.3.16
449+
dockerImageTag: 0.3.17
450450
documentationUrl: https://docs.airbyte.io/integrations/sources/mssql
451451
icon: mssql.svg
452452
sourceType: database
@@ -488,7 +488,7 @@
488488
- name: MySQL
489489
sourceDefinitionId: 435bb9a5-7887-4809-aa58-28c27df0d7ad
490490
dockerRepository: airbyte/source-mysql
491-
dockerImageTag: 0.5.5
491+
dockerImageTag: 0.5.6
492492
documentationUrl: https://docs.airbyte.io/integrations/sources/mysql
493493
icon: mysql.svg
494494
sourceType: database
@@ -522,7 +522,7 @@
522522
- name: Oracle DB
523523
sourceDefinitionId: b39a7370-74c3-45a6-ac3a-380d48520a83
524524
dockerRepository: airbyte/source-oracle
525-
dockerImageTag: 0.3.13
525+
dockerImageTag: 0.3.14
526526
documentationUrl: https://docs.airbyte.io/integrations/sources/oracle
527527
icon: oracle.svg
528528
sourceType: database
@@ -599,7 +599,7 @@
599599
- name: Postgres
600600
sourceDefinitionId: decd338e-5647-4c0b-adf4-da0e75f5a750
601601
dockerRepository: airbyte/source-postgres
602-
dockerImageTag: 0.4.7
602+
dockerImageTag: 0.4.8
603603
documentationUrl: https://docs.airbyte.io/integrations/sources/postgres
604604
icon: postgresql.svg
605605
sourceType: database
@@ -725,7 +725,7 @@
725725
- name: Snowflake
726726
sourceDefinitionId: e2d65910-8c8b-40a1-ae7d-ee2416b2bfa2
727727
dockerRepository: airbyte/source-snowflake
728-
dockerImageTag: 0.1.8
728+
dockerImageTag: 0.1.9
729729
documentationUrl: https://docs.airbyte.io/integrations/sources/snowflake
730730
icon: snowflake.svg
731731
sourceType: database

airbyte-config/init/src/main/resources/seed/source_specs.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@
12051205
supportsNormalization: false
12061206
supportsDBT: false
12071207
supported_destination_sync_modes: []
1208-
- dockerImage: "airbyte/source-cockroachdb:0.1.8"
1208+
- dockerImage: "airbyte/source-cockroachdb:0.1.9"
12091209
spec:
12101210
documentationUrl: "https://docs.airbyte.io/integrations/sources/cockroachdb"
12111211
connectionSpecification:
@@ -3251,7 +3251,7 @@
32513251
- - "client_secret"
32523252
oauthFlowOutputParameters:
32533253
- - "refresh_token"
3254-
- dockerImage: "airbyte/source-db2:0.1.8"
3254+
- dockerImage: "airbyte/source-db2:0.1.9"
32553255
spec:
32563256
documentationUrl: "https://docs.airbyte.io/integrations/sources/db2"
32573257
connectionSpecification:
@@ -4345,7 +4345,7 @@
43454345
supportsNormalization: false
43464346
supportsDBT: false
43474347
supported_destination_sync_modes: []
4348-
- dockerImage: "airbyte/source-mssql:0.3.16"
4348+
- dockerImage: "airbyte/source-mssql:0.3.17"
43494349
spec:
43504350
documentationUrl: "https://docs.airbyte.io/integrations/destinations/mssql"
43514351
connectionSpecification:
@@ -5044,7 +5044,7 @@
50445044
supportsNormalization: false
50455045
supportsDBT: false
50465046
supported_destination_sync_modes: []
5047-
- dockerImage: "airbyte/source-mysql:0.5.5"
5047+
- dockerImage: "airbyte/source-mysql:0.5.6"
50485048
spec:
50495049
documentationUrl: "https://docs.airbyte.io/integrations/sources/mysql"
50505050
connectionSpecification:
@@ -5433,7 +5433,7 @@
54335433
supportsNormalization: false
54345434
supportsDBT: false
54355435
supported_destination_sync_modes: []
5436-
- dockerImage: "airbyte/source-oracle:0.3.13"
5436+
- dockerImage: "airbyte/source-oracle:0.3.14"
54375437
spec:
54385438
documentationUrl: "https://docs.airbyte.io/integrations/sources/oracle"
54395439
connectionSpecification:
@@ -6072,7 +6072,7 @@
60726072
supportsNormalization: false
60736073
supportsDBT: false
60746074
supported_destination_sync_modes: []
6075-
- dockerImage: "airbyte/source-postgres:0.4.7"
6075+
- dockerImage: "airbyte/source-postgres:0.4.8"
60766076
spec:
60776077
documentationUrl: "https://docs.airbyte.com/integrations/sources/postgres"
60786078
connectionSpecification:
@@ -7521,7 +7521,7 @@
75217521
- - "client_secret"
75227522
oauthFlowOutputParameters:
75237523
- - "refresh_token"
7524-
- dockerImage: "airbyte/source-snowflake:0.1.8"
7524+
- dockerImage: "airbyte/source-snowflake:0.1.9"
75257525
spec:
75267526
documentationUrl: "https://docs.airbyte.io/integrations/sources/snowflake"
75277527
connectionSpecification:

airbyte-db/lib/src/main/java/io/airbyte/db/jdbc/AbstractJdbcCompatibleSourceOperations.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,21 @@ protected void setTimestamp(final PreparedStatement preparedStatement, final int
143143
// Parsing TIME as a TIMESTAMP might potentially break for ClickHouse cause it doesn't expect TIME
144144
// value in the following format
145145
try {
146-
var micro = value.substring(value.lastIndexOf('.') + 1, value.length() - 1);
147-
var nanos = micro + "000";
148-
var valueWithoutMicros = value.replace("." + micro, "");
146+
var valueWithoutMicros = value;
147+
StringBuilder nanos = new StringBuilder();
148+
var dotIndex = value.indexOf(".");
149+
if (dotIndex > 0) {
150+
var micro = value.substring(value.lastIndexOf('.') + 1, value.length() - 1);
151+
nanos.append(micro);
152+
valueWithoutMicros = value.replace("." + micro, "");
153+
}
154+
while (nanos.length() != 9) {
155+
nanos.append("0");
156+
}
149157

150158
var timestamp = Timestamp
151159
.from(DataTypeUtils.DATE_FORMAT.parse(valueWithoutMicros).toInstant());
152-
timestamp.setNanos(Integer.parseInt(nanos));
160+
timestamp.setNanos(Integer.parseInt(nanos.toString()));
153161
preparedStatement.setTimestamp(parameterIndex, timestamp);
154162
} catch (final ParseException e) {
155163
throw new RuntimeException(e);

airbyte-integrations/connectors/source-cockroachdb-strict-encrypt/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ ENV APPLICATION source-cockroachdb-strict-encrypt
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=0.1.5
19+
LABEL io.airbyte.version=0.1.6
2020
LABEL io.airbyte.name=airbyte/source-cockroachdb-strict-encrypt

airbyte-integrations/connectors/source-cockroachdb/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ ENV APPLICATION source-cockroachdb
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=0.1.8
19+
LABEL io.airbyte.version=0.1.9
2020
LABEL io.airbyte.name=airbyte/source-cockroachdb

airbyte-integrations/connectors/source-db2-strict-encrypt/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ ENV APPLICATION source-db2-strict-encrypt
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=0.1.5
19+
LABEL io.airbyte.version=0.1.6
2020
LABEL io.airbyte.name=airbyte/source-db2-strict-encrypt

airbyte-integrations/connectors/source-db2/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ ENV APPLICATION source-db2
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=0.1.8
19+
LABEL io.airbyte.version=0.1.9
2020
LABEL io.airbyte.name=airbyte/source-db2

airbyte-integrations/connectors/source-mssql-strict-encrypt/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ ENV APPLICATION source-mssql-strict-encrypt
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=0.1.8
19+
LABEL io.airbyte.version=0.1.9
2020
LABEL io.airbyte.name=airbyte/source-mssql-strict-encrypt

airbyte-integrations/connectors/source-mssql/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ ENV APPLICATION source-mssql
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=0.3.16
19+
LABEL io.airbyte.version=0.3.17
2020
LABEL io.airbyte.name=airbyte/source-mssql

airbyte-integrations/connectors/source-mysql-strict-encrypt/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ ENV APPLICATION source-mysql-strict-encrypt
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=0.1.11
19+
LABEL io.airbyte.version=0.1.12
2020
LABEL io.airbyte.name=airbyte/source-mysql-strict-encrypt

airbyte-integrations/connectors/source-mysql/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ ENV APPLICATION source-mysql
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=0.5.5
19+
LABEL io.airbyte.version=0.5.6
2020
LABEL io.airbyte.name=airbyte/source-mysql

airbyte-integrations/connectors/source-oracle-strict-encrypt/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ ENV TZ UTC
1717

1818
COPY --from=build /airbyte /airbyte
1919

20-
LABEL io.airbyte.version=0.1.5
20+
LABEL io.airbyte.version=0.1.6
2121
LABEL io.airbyte.name=airbyte/source-oracle-strict-encrypt

airbyte-integrations/connectors/source-oracle/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ ENV TZ UTC
88
COPY build/distributions/${APPLICATION}*.tar ${APPLICATION}.tar
99
RUN tar xf ${APPLICATION}.tar --strip-components=1
1010

11-
LABEL io.airbyte.version=0.3.13
11+
LABEL io.airbyte.version=0.3.14
1212
LABEL io.airbyte.name=airbyte/source-oracle

airbyte-integrations/connectors/source-postgres-strict-encrypt/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ ENV APPLICATION source-postgres-strict-encrypt
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=0.1.9
19+
LABEL io.airbyte.version=0.1.10
2020
LABEL io.airbyte.name=airbyte/source-postgres-strict-encrypt

airbyte-integrations/connectors/source-postgres/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ ENV APPLICATION source-postgres
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=0.4.7
19+
LABEL io.airbyte.version=0.4.8
2020
LABEL io.airbyte.name=airbyte/source-postgres

airbyte-integrations/connectors/source-snowflake/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ ENV APPLICATION source-snowflake
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=0.1.8
19+
LABEL io.airbyte.version=0.1.9
2020
LABEL io.airbyte.name=airbyte/source-snowflake

docs/integrations/sources/cockroachdb.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Your database user should now be ready for use with Airbyte.
9595

9696
| Version | Date | Pull Request | Subject |
9797
| :--- | :--- | :--- | :--- |
98+
| 0.1.9 | 2022-02-21 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Fixed cursor for old connectors that use non-microsecond format. Now connectors work with both formats |
9899
| 0.1.8 | 2022-02-18 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Updated timestamp transformation with microseconds |
99100
| 0.1.7 | 2022-02-14 | [10256](https://github.com/airbytehq/airbyte/pull/10256) | Add `-XX:+ExitOnOutOfMemoryError` JVM option |
100101
| 0.1.6 | 2022-02-08 | [10173](https://github.com/airbytehq/airbyte/pull/10173) | Improved discovering tables in case if user does not have permissions to any table |
@@ -107,6 +108,7 @@ Your database user should now be ready for use with Airbyte.
107108

108109
| Version | Date | Pull Request | Subject |
109110
|:--------| :--- | :--- | :--- |
111+
| 0.1.6 | 2022-02-21 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Fixed cursor for old connectors that use non-microsecond format. Now connectors work with both formats |
110112
| 0.1.5 | 2022-02-18 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Updated timestamp transformation with microseconds |
111113
| 0.1.4 | 2022-02-14 | [10256](https://github.com/airbytehq/airbyte/pull/10256) | Add `-XX:+ExitOnOutOfMemoryError` JVM option |
112114
| 0.1.3 | 2022-02-08 | [10173](https://github.com/airbytehq/airbyte/pull/10173) | Improved discovering tables in case if user does not have permissions to any table |

docs/integrations/sources/db2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ You can also enter your own password for the keystore, but if you don't, the pas
6262

6363
| Version | Date | Pull Request | Subject |
6464
| :--- | :--- | :--- | :--- |
65+
| 0.1.9 | 2022-02-21 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Fixed cursor for old connectors that use non-microsecond format. Now connectors work with both formats |
6566
| 0.1.8 | 2022-02-18 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Updated timestamp transformation with microseconds |
6667
| 0.1.7 | 2022-02-14 | [10256](https://github.com/airbytehq/airbyte/pull/10256) | Add `-XX:+ExitOnOutOfMemoryError` JVM option |****
6768
| 0.1.6 | 2022-02-08 | [10173](https://github.com/airbytehq/airbyte/pull/10173) | Improved discovering tables in case if user does not have permissions to any table |

docs/integrations/sources/mssql.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ If you do not see a type in this list, assume that it is coerced into a string.
294294

295295
| Version | Date | Pull Request | Subject |
296296
|:------- | :--------- | :----------------------------------------------------- | :------------------------------------- |
297+
| 0.3.17 | 2022-02-21 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Fixed cursor for old connectors that use non-microsecond format. Now connectors work with both formats |
297298
| 0.3.16 | 2022-02-18 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Updated timestamp transformation with microseconds |
298299
| 0.3.15 | 2022-02-14 | [10256](https://github.com/airbytehq/airbyte/pull/10256) | Add `-XX:+ExitOnOutOfMemoryError` JVM option |
299300
| 0.3.14 | 2022-01-24 | [9554](https://github.com/airbytehq/airbyte/pull/9554) | Allow handling of java sql date in CDC |

docs/integrations/sources/mysql.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ If you do not see a type in this list, assume that it is coerced into a string.
182182

183183
| Version | Date | Pull Request | Subject |
184184
|:--------|:-------------|:-----------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------|
185+
| 0.5.6 | 2022-02-21 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Fixed cursor for old connectors that use non-microsecond format. Now connectors work with both formats |
185186
| 0.5.5 | 2022-02-18 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Updated timestamp transformation with microseconds |
186187
| 0.5.4 | 2022-02-11 | [10251](https://github.com/airbytehq/airbyte/issues/10251) | bug Source MySQL CDC: sync failed when has Zero-date value in mandatory column |
187188
| 0.5.2 | 2021-12-14 | [6425](https://github.com/airbytehq/airbyte/issues/6425) | MySQL CDC sync fails because starting binlog position not found in DB |

docs/integrations/sources/oracle.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ Airbite has the ability to connect to the Oracle source with 3 network connectiv
132132

133133
| Version | Date | Pull Request | Subject |
134134
|:--------| :--- | :--- |:------------------------------------------------|
135+
| 0.3.14 | 2022-02-21 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Fixed cursor for old connectors that use non-microsecond format. Now connectors work with both formats |
135136
| 0.3.13 | 2022-02-18 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Updated timestamp transformation with microseconds |
136137
| 0.3.12 | 2022-02-14 | [10256](https://github.com/airbytehq/airbyte/pull/10256) | Add `-XX:+ExitOnOutOfMemoryError` JVM option |
137138
| 0.3.11 | 2021-12-24 | [8958](https://github.com/airbytehq/airbyte/pull/8958) | Add support for JdbcType.ARRAY |

docs/integrations/sources/postgres.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ According to Postgres [documentation](https://www.postgresql.org/docs/14/datatyp
270270

271271
| Version | Date | Pull Request | Subject |
272272
|:--------|:-----------|:-------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------|
273+
| 0.4.8 | 2022-02-21 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Fixed cursor for old connectors that use non-microsecond format. Now connectors work with both formats |
273274
| 0.4.7 | 2022-02-18 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Updated timestamp transformation with microseconds |
274275
| 0.4.6 | 2022-02-14 | [10256](https://github.com/airbytehq/airbyte/pull/10256) | (unpublished) Add `-XX:+ExitOnOutOfMemoryError` JVM option |
275276
| 0.4.5 | 2022-02-08 | [10173](https://github.com/airbytehq/airbyte/pull/10173) | Improved discovering tables in case if user does not have permissions to any table |

docs/integrations/sources/snowflake.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Your database user should now be ready for use with Airbyte.
7676

7777
| Version | Date | Pull Request | Subject |
7878
| :--- | :--- | :--- | :--- |
79+
| 0.1.9 | 2022-02-21 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Fixed cursor for old connectors that use non-microsecond format. Now connectors work with both formats |
7980
| 0.1.8 | 2022-02-18 | [10242](https://github.com/airbytehq/airbyte/pull/10242) | Updated timestamp transformation with microseconds |
8081
| 0.1.7 | 2022-02-14 | [10256](https://github.com/airbytehq/airbyte/pull/10256) | Add `-XX:+ExitOnOutOfMemoryError` JVM option |
8182
| 0.1.6 | 2022-01-25 | [9623](https://github.com/airbytehq/airbyte/pull/9623) | Add jdbc_url_params support for optional JDBC parameters |

0 commit comments

Comments
 (0)