-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Postgres source: added items for array data type #15138
Conversation
/test connector=connectors/source-postgres
Build FailedTest summary info:
|
|
||
public static final JsonSchemaType STRING = JsonSchemaType.builder(JsonSchemaPrimitive.STRING).build(); | ||
public static final JsonSchemaType NUMBER = JsonSchemaType.builder(JsonSchemaPrimitive.NUMBER).build(); | ||
public static final JsonSchemaType INTEGER = JsonSchemaType.builder(JsonSchemaPrimitive.NUMBER).withAirbyteType(AIRYBTE_INT_TYPE).build(); | ||
public static final JsonSchemaType BOOLEAN = JsonSchemaType.builder(JsonSchemaPrimitive.BOOLEAN).build(); | ||
public static final JsonSchemaType OBJECT = JsonSchemaType.builder(JsonSchemaPrimitive.OBJECT).build(); | ||
public static final JsonSchemaType ARRAY_WITH_STRING_ITEMS = JsonSchemaType.builder(JsonSchemaPrimitive.ARRAY).withItems(STRING_TYPE).build(); |
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.
why do we have a constant for an array that contains items of a certain type?
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.
Because previously we just have Array without items and it was the reason of failing during refresh schema. Currently throwing exception in such case was changed to logging error message and we are adding items to array on source side.
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.
/test connector=connectors/source-postgres
Build PassedTest summary info:
|
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.
Unless my context is incorrect, the issue is that for JsonSchemaType.ARRAY
there should be a corresponding field items
that indicates the type of information in the array: https://cswr.github.io/JsonSchema/spec/arrays/
What this solution seems to implement is a limited scope of only having the items
be only of type strings
which as Charles has mentioned is not the only datatype that postgres arrays can support. Feel free to correct me if the understanding isn't clear but having the context included in the PR body would be helpful for everyone to get up to speed
Furthermore, since this is a change in the current behavior it would seem that a good practice is to add a regression test that covers the scenario where items
field is not defined for array
datatypes and also tests that validates the various datatypes that postgres arrays
supports. How can we help make sure you're unblocked on this issue?
@ryankfu, @cgardens you are right, solution that implemented in this PR was just for handling on-call issue and has limitation about types of items as possible quick solution. As far as on-call issue was fixed by PR and this approach has concerns, we can finish with temporal solution and discuss long term approach. |
closing as stale. feel free to re-open if this is something we are still working on. |
What
Describe what the change is solving
It helps to add screenshots if it affects the frontend.
How
Describe the solution
Recommended reading order
x.java
y.python
🚨 User Impact 🚨
Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.
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.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
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/publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including 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/publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then 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.