Skip to content

Commit 16de42f

Browse files
yurii-bidiukgrishickoctavia-squidington-iii
authored
🎉Source Postgres (CDC) - add support of tsquery type (#13083)
* cdc - add support of tsquery type * rebase on master * Add changes made by the build * Update version in Dockerfile * auto-bump connector version Co-authored-by: grishick <[email protected]> Co-authored-by: Octavia Squidington III <[email protected]>
1 parent b90e5b1 commit 16de42f

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@
715715
- name: Postgres
716716
sourceDefinitionId: decd338e-5647-4c0b-adf4-da0e75f5a750
717717
dockerRepository: airbyte/source-postgres
718-
dockerImageTag: 0.4.17
718+
dockerImageTag: 0.4.18
719719
documentationUrl: https://docs.airbyte.io/integrations/sources/postgres
720720
icon: postgresql.svg
721721
sourceType: database

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -6607,7 +6607,7 @@
66076607
supportsNormalization: false
66086608
supportsDBT: false
66096609
supported_destination_sync_modes: []
6610-
- dockerImage: "airbyte/source-postgres:0.4.17"
6610+
- dockerImage: "airbyte/source-postgres:0.4.18"
66116611
spec:
66126612
documentationUrl: "https://docs.airbyte.com/integrations/sources/postgres"
66136613
connectionSpecification:

airbyte-integrations/bases/debezium/src/main/java/io/airbyte/integrations/debezium/internals/PostgresConverter.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public class PostgresConverter implements CustomConverter<SchemaBuilder, Relatio
2323
private final String[] BIT_TYPES = {"BIT", "VARBIT"};
2424
private final String[] MONEY_ITEM_TYPE = {"MONEY"};
2525
private final String[] GEOMETRICS_TYPES = {"BOX", "CIRCLE", "LINE", "LSEG", "POINT", "POLYGON", "PATH"};
26-
private final String[] TEXT_TYPES = {"VARCHAR", "VARBINARY", "BLOB", "TEXT", "LONGTEXT", "TINYTEXT", "MEDIUMTEXT", "INVENTORY_ITEM", "TSVECTOR"};
26+
private final String[] TEXT_TYPES =
27+
{"VARCHAR", "VARBINARY", "BLOB", "TEXT", "LONGTEXT", "TINYTEXT", "MEDIUMTEXT", "INVENTORY_ITEM", "TSVECTOR", "TSQUERY"};
2728

2829
@Override
2930
public void configure(final Properties props) {}

airbyte-integrations/connectors/source-postgres/Dockerfile

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

airbyte-integrations/connectors/source-postgres/src/test-integration/java/io/airbyte/integrations/io/airbyte/integration_tests/sources/CdcPostgresSourceDatatypeTest.java

+8
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,14 @@ protected void initTests() {
533533
.addInsertValues("to_tsvector('The quick brown fox jumped over the lazy dog.')")
534534
.addExpectedValues("'brown':3 'dog':9 'fox':4 'jumped':5 'lazy':8 'over':6 'quick':2 'the':1,7")
535535
.build());
536+
537+
addDataTypeTestData(
538+
TestDataHolder.builder()
539+
.sourceType("tsquery")
540+
.airbyteType(JsonSchemaType.STRING)
541+
.addInsertValues("null", "'fat & (rat | cat)'::tsquery", "'fat:ab & cat'::tsquery")
542+
.addExpectedValues(null, "'fat' & ( 'rat' | 'cat' )", "'fat':AB & 'cat'")
543+
.build());
536544
}
537545

538546
}

docs/integrations/sources/postgres.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ According to Postgres [documentation](https://www.postgresql.org/docs/14/datatyp
257257
| `timetz` | string | |
258258
| `timestamp` | string | |
259259
| `timestamptz` | string | |
260-
| `tsquery` | string | Not supported with CDC node. Parsed value is null. Issue: [#7911](https://github.com/airbytehq/airbyte/issues/7911) |
260+
| `tsquery` | string | |
261261
| `tsvector` | string | |
262262
| `uuid` | string | |
263263
| `xml` | string | |
@@ -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.18 | 2022-05-25 | [13083](https://github.com/airbytehq/airbyte/pull/13083) | Add support for tsquey type |
273274
| 0.4.17 | 2022-05-19 | [13016](https://github.com/airbytehq/airbyte/pull/13016) | CDC modify schema to allow null values |
274275
| 0.4.16 | 2022-05-14 | [12840](https://github.com/airbytehq/airbyte/pull/12840) | Added custom JDBC parameters field |
275276
| 0.4.15 | 2022-05-13 | [12834](https://github.com/airbytehq/airbyte/pull/12834) | Fix the bug that the connector returns empty catalog for Azure Postgres database |

0 commit comments

Comments
 (0)