Skip to content

Commit 5ceb14a

Browse files
use replace function only when null is present (#21523)
* use replace function only when null is present * upgrade version * auto-bump connector version Co-authored-by: Octavia Squidington III <[email protected]>
1 parent 13eac98 commit 5ceb14a

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@
13411341
- name: Postgres
13421342
sourceDefinitionId: decd338e-5647-4c0b-adf4-da0e75f5a750
13431343
dockerRepository: airbyte/source-postgres
1344-
dockerImageTag: 1.0.41
1344+
dockerImageTag: 1.0.42
13451345
documentationUrl: https://docs.airbyte.com/integrations/sources/postgres
13461346
icon: postgresql.svg
13471347
sourceType: database

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11606,7 +11606,7 @@
1160611606
supportsNormalization: false
1160711607
supportsDBT: false
1160811608
supported_destination_sync_modes: []
11609-
- dockerImage: "airbyte/source-postgres:1.0.41"
11609+
- dockerImage: "airbyte/source-postgres:1.0.42"
1161011610
spec:
1161111611
documentationUrl: "https://docs.airbyte.com/integrations/sources/postgres"
1161211612
connectionSpecification:

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=1.0.41
19+
LABEL io.airbyte.version=1.0.42
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=1.0.41
19+
LABEL io.airbyte.version=1.0.42
2020
LABEL io.airbyte.name=airbyte/source-postgres

airbyte-integrations/connectors/source-relational-db/src/main/java/io/airbyte/integrations/source/relationaldb/StateDecoratingIterator.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,14 @@ public StateDecoratingIterator(final Iterator<AirbyteMessage> messageIterator,
8888

8989
private String getCursorCandidate(final AirbyteMessage message) {
9090
final String cursorCandidate = message.getRecord().getData().get(cursorField).asText();
91-
return (cursorCandidate != null ? cursorCandidate.replaceAll("\u0000", "") : null);
91+
return (cursorCandidate != null ? replaceNull(cursorCandidate) : null);
92+
}
93+
94+
private String replaceNull(final String cursorCandidate) {
95+
if (cursorCandidate.contains("\u0000")) {
96+
return cursorCandidate.replaceAll("\u0000", "");
97+
}
98+
return cursorCandidate;
9299
}
93100

94101
/**

docs/integrations/sources/postgres.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ The root causes is that the WALs needed for the incremental sync has been remove
411411

412412
| Version | Date | Pull Request | Subject |
413413
|:--------|:-----------|:---------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
414+
| 1.0.42 | 2022-01-23 | [21523](https://github.com/airbytehq/airbyte/pull/21523) | Check for null in cursor values before replacing. |
414415
| 1.0.41 | 2022-01-25 | [20939](https://github.com/airbytehq/airbyte/pull/20939) | Adjust batch selection memory limits databases. |
415416
| 1.0.40 | 2023-01-24 | [21825](https://github.com/airbytehq/airbyte/pull/21825) | Put back the original change that will cause an incremental sync to error if table contains a NULL value in cursor column. |
416417
| 1.0.39 | 2023-01-20 | [21683](https://github.com/airbytehq/airbyte/pull/21683) | Speed up esmtimates for trace messages in non-CDC mode. |

0 commit comments

Comments
 (0)