-
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
🎉 Source Postgres: support all Postgres 14 types #8726
Merged
Merged
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2fb2000
Add skeleton to support all postgres types
tuliren ea13259
Consolidate type tests
tuliren 1d6440d
Fix corner cases
tuliren 0f46c26
Bump postgres version
tuliren b119f42
Add tests for time and timetz
tuliren 97569e7
Format code
tuliren e1dac8e
Revert date to timestamp
tuliren df460c7
Update comment
tuliren 3bee7d1
Fix unit tests
tuliren 896910c
🐛 Jdbc sources: switch from "string" to "array" schema type for colum…
yurii-bidiuk 5ae72e8
Merge branch 'master' into liren/postgres-types-v2
tuliren 9b3eb23
Merge branch 'master' into liren/postgres-types-v2
tuliren aebb263
Revert changes to support special number values
tuliren 9926723
Revert infinity and nan assertion in unit tests
tuliren 9c4ed9f
Update documentation
tuliren 1b7d7a7
Bump postgres source version in seed
tuliren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
does json have a concept of infinity and Nan? how are these represented when output from the connector itself?
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.
Good catch. Actually Json numbers do not support
NaN
or infinity. To support these three special values, we need to make sure that the destination can handle them. Otherwise, the destination will fail. Too bad, I need to revert this.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.
like how we currently handle dates, you can output them in a string type with a format hint.
Then have normalization handle the special format hint for these special numbers accordingly for the destination
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.
@ChristopheDuong, nice.
Where the code that handles this? I'd like to see what the format hint looks like.
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.
In the json, it's "string" type.
Then, on normalization, if we find a format hint, we know it's actually a date not a string:
airbyte/airbyte-integrations/bases/base-normalization/normalization/transform_catalog/utils.py
Line 33 in c5fc568
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.
Example of catalog.json with date:
airbyte/airbyte-integrations/bases/base-normalization/integration_tests/resources/test_simple_streams/data_input/catalog.json
Line 17 in c5fc568
so you can have a special string-float type instead of using json's number in order to encode special float values:
and normalization can handle it in SQL: For example in bigquery, based on https://stackoverflow.com/a/53692265:
or differently for another destination