- Notifications
You must be signed in to change notification settings - Fork 4.9k
🐛 source-postgres: fix jsonb[] handling bug #30534
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
Conversation
Before Merging a Connector Pull RequestWow! What a great pull request you have here! 🎉 To merge this PR, ensure the following has been done/considered for each connector added or updated:
If the checklist is complete, but the CI check is failing,
|
Coverage report for source-postgres
|
|
| Step | Result |
|---|---|
| Build connector tar | ✅ |
| Build source-postgres docker image for platform linux/x86_64 | ✅ |
| Java Connector Unit Tests | ✅ |
| Java Connector Integration Tests | ✅ |
| Acceptance tests | ✅ |
| Validate airbyte-integrations/connectors/source-postgres/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| Connector version increment check | ❌ |
| QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-postgres test |
| Step | Result |
|---|---|
| Build connector tar | ✅ |
| Build source-postgres docker image for platform linux/x86_64 | ✅ |
| Java Connector Unit Tests | ✅ |
| Java Connector Integration Tests | ✅ |
| Acceptance tests | ✅ |
| Validate airbyte-integrations/connectors/source-postgres/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| Connector version increment check | ✅ |
| QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-postgres test| The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
60b2c4d to 721bc36 Compare |
| Step | Result |
|---|---|
| Build connector tar | ✅ |
| Build source-postgres docker image for platform linux/x86_64 | ✅ |
| Java Connector Unit Tests | ✅ |
| Java Connector Integration Tests | ✅ |
| Acceptance tests | ✅ |
| Validate airbyte-integrations/connectors/source-postgres/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| Connector version increment check | ❌ |
| QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-postgres test721bc36 to 1935d27 Compare 1935d27 to 851f593 Compare |
| Step | Result |
|---|---|
| Build connector tar | ✅ |
| Build source-postgres docker image for platform linux/x86_64 | ✅ |
| Java Connector Unit Tests | ✅ |
| Java Connector Integration Tests | ✅ |
| Acceptance tests | ✅ |
| Validate airbyte-integrations/connectors/source-postgres/metadata.yaml | ✅ |
| Connector version semver check | ✅ |
| Connector version increment check | ✅ |
| QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-postgres test
nguyenaiden left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! Could you make sure to bump the version in source-postgres-strict-encrypt as well?
| default -> json.put(columnName, value); | ||
| default -> { | ||
| if (columnInfo.columnType.isArrayType()) { | ||
| putArray(json, columnName, resultSet, colIndex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come jsonb[] type not falling into case ARRAY ?
| .withItems(JsonSchemaType.builder(JsonSchemaPrimitive.STRING).build()) | ||
| .build()) | ||
| .addInsertValues("ARRAY['{\"foo\":\"bar\"}'::JSONB, NULL]") | ||
| .addExpectedValues("[\"{\\\"foo\\\": \\\"bar\\\"}\",null]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still seem likes Postgres's string representation of the array. I think we want something along the lines of ["{\"foo\": \"bar\"}"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, disregard this. It's Java's representation of the array. We've tested this version manually and it fixes the regression 👍
This PR fixes #29172 by adding a new subcase for unmatched
PostgresTypes incopyToJsonField. This new subcase distinguishes remaining array types from remaining non-array types. Added a unit test to cover.Fixes #29551.