Skip to content
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

fix: postgres string type #12836

Merged
merged 4 commits into from
May 27, 2022

Conversation

shrodingers
Copy link
Contributor

@shrodingers shrodingers commented May 13, 2022

What

Solves an issue with normalization on incremental sync on postgres destination when adding some columns after initial full refresh sync which type infers to string and whose length > 256
These columns were created with a 256 columns limit due to a DBT behaviour (already opened an issue here. They have something coming out about that in dbt_utils, but in the meantime I think it is better to override the type_string macro to use text instead of varchar (text is correctly handled by dbt)

How

Added an override on the type_string macro for postgres in normalization macros

🚨 User Impact 🚨

No breaking change, except the fact that string columns will now have type text instead of varchar

Linked to this Issue for more context

Copy link
Member

@marcosmarxm marcosmarxm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you adda TODO to remove it after your suggestion is done in dbt side?

@shrodingers
Copy link
Contributor Author

Hey @marcosmarxm, just added the TODO, in the meantime i'm going to also submit a PR to DBT repo

@marcosmarxm marcosmarxm requested a review from edgao May 21, 2022 01:21
@marcosmarxm marcosmarxm self-assigned this May 21, 2022
Copy link
Contributor

@edgao edgao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shrodingers I've got one question just to make sure I've modeled this correctly, but otherwise LGTM!

Copy link
Contributor

@edgao edgao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚛

…late/macros/cross_db_utils/datatypes.sql


Added the dbt upgrade condition to TODO

Co-authored-by: Edward Gao <[email protected]>
@marcosmarxm
Copy link
Member

Merging this I'll publish a new normalization version with #12699

@marcosmarxm marcosmarxm merged commit a3c3cf7 into airbytehq:master May 27, 2022
jscottpolevault pushed a commit to jscottpolevault/airbyte that referenced this pull request Jun 1, 2022
* fix: postgres string type

* feat: added TODO for removal

* fix: better comment style

* Update airbyte-integrations/bases/base-normalization/dbt-project-template/macros/cross_db_utils/datatypes.sql

Added the dbt upgrade condition to TODO

Co-authored-by: Edward Gao <[email protected]>

Co-authored-by: Edward Gao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants