Source Postgres: Handle Arrays data types - #16990
Conversation
|
NOTE
|
|
NOTE
|
|
NOTE
|
|
NOTE
|
|
NOTE
|
|
NOTE
|
|
NOTE
|
…rray-types' into vmaltsev/15157-postgres-handle-array-types
Subodh Chaturvedi (subodh1810)
left a comment
There was a problem hiding this comment.
We are almost there! Edward Gao (@edgao) can you clarify how the new items attribute in the json schema will be used downstream?
| return Arrays.stream(values).map(value -> value == null ? null : convertToTimestamp(value)).collect(Collectors.toList()); | ||
| case "_TIMESTAMPTZ": | ||
| return Arrays.stream(values).map(value -> value == null ? null : convertToTimestampWithTimezone(value)).collect(Collectors.toList()); | ||
| case "_TIMETZ": |
There was a problem hiding this comment.
Let's add this logic to method convertToTimeWithTimezone in class DateTimeConverter and add a condition like
if (time instanceof final java.sql.Time timetz) then do what you are doing
| public static final String CONTENT_ENCODING = "contentEncoding"; | ||
| public static final String BASE_64 = "base64"; | ||
| public static final String AIRBYTE_TYPE = "airbyte_type"; | ||
| public static final String ITEMS = "items"; |
There was a problem hiding this comment.
I meant will this be used in downstream in normalization?
| node.set(columnName, arrayNode); | ||
| } | ||
|
|
||
| private void putTimestampTzArray(ObjectNode node, String columnName, ResultSet resultSet, int colIndex) throws SQLException { |
There was a problem hiding this comment.
this got left out
Affected Connector ReportNOTE
|
| Connector | Version | Changelog | Publish |
|---|---|---|---|
source-alloydb |
1.0.17 |
✅ | ✅ |
source-alloydb-strict-encrypt |
1.0.17 |
✅ | ⚠ (not in seed) |
source-bigquery |
0.2.3 |
✅ | ✅ |
source-clickhouse |
0.1.14 |
✅ | ✅ |
source-clickhouse-strict-encrypt |
0.1.14 |
✅ | ⚠ (not in seed) |
source-cockroachdb |
0.1.18 |
✅ | ✅ |
source-cockroachdb-strict-encrypt |
0.1.18 |
✅ | ⚠ (not in seed) |
source-db2 |
0.1.16 |
✅ | ✅ |
source-db2-strict-encrypt |
0.1.16 |
✅ | ⚠ (not in seed) |
source-dynamodb |
0.1.0 |
❌ (changelog missing) |
✅ |
source-e2e-test |
2.1.3 |
✅ | ✅ |
source-e2e-test-cloud |
2.1.1 |
⚠ (doc not found) |
⚠ (not in seed) |
source-elasticsearch |
0.1.0 |
✅ | ✅ |
source-jdbc |
0.3.5 |
⚠ (doc not found) |
⚠ (not in seed) |
source-kafka |
0.2.2 |
✅ | ✅ |
source-mongodb-strict-encrypt |
0.1.19 |
⚠ (doc not found) |
⚠ (not in seed) |
source-mongodb-v2 |
0.1.19 |
✅ | ✅ |
source-mssql |
0.4.25 |
✅ | ✅ |
source-mssql-strict-encrypt |
0.4.25 |
✅ | ⚠ (not in seed) |
source-mysql |
1.0.13 |
✅ | ✅ |
source-mysql-strict-encrypt |
1.0.13 |
✅ | ⚠ (not in seed) |
source-oracle |
0.3.21 |
✅ | ✅ |
source-oracle-strict-encrypt |
0.3.21 |
✅ | ⚠ (not in seed) |
source-postgres |
1.0.27 |
✅ | ✅ |
source-postgres-strict-encrypt |
1.0.27 |
✅ | ⚠ (not in seed) |
source-redshift |
0.3.15 |
✅ | ✅ |
source-scaffold-java-jdbc |
0.1.0 |
⚠ (doc not found) |
⚠ (not in seed) |
source-sftp |
0.1.2 |
✅ | ✅ |
source-snowflake |
0.1.26 |
✅ | ✅ |
source-tidb |
0.2.1 |
✅ | ✅ |
- See "Actionable Items" below for how to resolve warnings and errors.
✅ Destinations (0)
| Connector | Version | Changelog | Publish |
|---|
- See "Actionable Items" below for how to resolve warnings and errors.
✅ Other Modules (0)
Actionable Items
(click to expand)
| Category | Status | Actionable Item |
|---|---|---|
| Version | ❌ mismatch |
The version of the connector is different from its normal variant. Please bump the version of the connector. |
| ⚠ doc not found |
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug. |
|
| Changelog | ⚠ doc not found |
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug. |
| ❌ changelog missing |
There is no chnagelog for the current version of the connector. If you are the author of the current version, please add a changelog. | |
| Publish | ⚠ not in seed |
The connector is not in the seed file (e.g. source_definitions.yaml), so its publication status cannot be checked. This can be normal (e.g. some connectors are cloud-specific, and only listed in the cloud seed file). Please double-check to make sure that it is not a bug. |
| ❌ diff seed version |
The connector exists in the seed file, but the latest version is not listed there. This usually means that the latest version is not published. Please use the /publish command to publish the latest version. |
Edward Gao (edgao)
left a comment
There was a problem hiding this comment.
lgtm, probably worth waiting for Subodh Chaturvedi (@subodh1810)'s approval before merging
…rray-types' into vmaltsev/15157-postgres-handle-array-types
|
/publish connector=connectors/source-postgres-strict-encrypt
if you have connectors that successfully published but failed definition generation, follow step 4 here |
|
/publish connector=connectors/source-postgres
if you have connectors that successfully published but failed definition generation, follow step 4 here |
What
At the moment, when emitting data of the array type, a json schema is formed that looks like an array without items, and the data is transferred simply as a string. this can lead to incorrect data transfer and also some types of arrays are not implemented at all
Data type handling should be able to handle all data types that Postgres supports
How
Updated mapping of all types of arrays for json schema, implemented conversion for СDС and STANDARD replication
Example
Recommended reading order
JsonSchemaType.javaPostgresSourceOperations.javaPostgresConverter.java🚨 User Impact 🚨
There should not be any user impact
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret./gradlew :airbyte-integrations:connectors:<name>:integrationTest.README.mdbootstrap.md. See description and examplesdocs/integrations/<source or destination>/<name>.mdincluding changelog. See changelog exampledocs/integrations/README.mdairbyte-integrations/builds.mdAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>command is passing/publishcommand described hereUpdating a connector
Community member or Airbyter
airbyte_secret./gradlew :airbyte-integrations:connectors:<name>:integrationTest.README.mdbootstrap.md. See description and examplesdocs/integrations/<source or destination>/<name>.mdincluding changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>command is passing/publishcommand described hereConnector Generator
-scaffoldin their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplatesthen checking in your changesTests
Unit
Put your unit tests output here.
Integration
Put your integration tests output here.
Acceptance
Put your acceptance tests output here.