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

Feat/1711 create with not exists dlt tables #1740

Merged
merged 6 commits into from
Aug 26, 2024

Conversation

rudolfix
Copy link
Collaborator

@rudolfix rudolfix commented Aug 24, 2024

Description

fixes #1711

NOTE: this will prevent race conditions only if CREATE TABLE IF NOT EXISTS is atomic. ie. on postgres it is not if table contains partitions: https://stackoverflow.com/questions/77486178/how-to-prevent-create-table-if-not-exists-fail-with-duplicate-table

still the chances of a race are way smaller

also fixes two minor issues, see commit list below

@rudolfix rudolfix added the ci full run the full load tests on pr label Aug 24, 2024
@rudolfix rudolfix self-assigned this Aug 24, 2024
Copy link

netlify bot commented Aug 24, 2024

Deploy Preview for dlt-hub-docs canceled.

Name Link
🔨 Latest commit 40b9943
🔍 Latest deploy log https://app.netlify.com/sites/dlt-hub-docs/deploys/66ccd030d471b20008078a3b

@rudolfix rudolfix added the support This issue is monitored by Solution Engineer label Aug 25, 2024
@rudolfix rudolfix force-pushed the feat/1711-create-with-not-exists-dlt-tables branch from 0c19c0a to 7f1f76f Compare August 25, 2024 21:30
@rudolfix rudolfix requested a review from VioletM August 25, 2024 21:30
@rudolfix rudolfix marked this pull request as ready for review August 25, 2024 21:30
VioletM
VioletM previously approved these changes Aug 26, 2024
@@ -76,6 +76,7 @@ class DestinationCapabilitiesContext(ContainerInjectableContext):
# use naming convention in the schema
naming_convention: TNamingConventionReferenceArg = None
alter_add_multi_column: bool = True
create_table_not_exists: bool = True
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to rename it that it's clear it for _dlt tables:
For ex, create_dlt_table_if_not_exists

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is in destination caps. but I will rename it to make clear what it means

@rudolfix rudolfix removed the ci full run the full load tests on pr label Aug 26, 2024
VioletM
VioletM previously approved these changes Aug 26, 2024
@rudolfix rudolfix force-pushed the feat/1711-create-with-not-exists-dlt-tables branch from bcdd8c8 to 40b9943 Compare August 26, 2024 18:57
@rudolfix rudolfix merged commit 935dc09 into devel Aug 26, 2024
55 of 56 checks passed
@rudolfix rudolfix deleted the feat/1711-create-with-not-exists-dlt-tables branch August 26, 2024 22:20
willi-mueller pushed a commit that referenced this pull request Sep 2, 2024
* uses normalized column names when linking tables in relational

* destination cap if create table if not exits supported

* generates IF NOT EXISTS for dlt tables

* adds logging for terminal and retry exception in run_managed of load job

* passes schema update to be collected in trace in filesystem

* fixes job log exception message
willi-mueller pushed a commit that referenced this pull request Sep 2, 2024
* uses normalized column names when linking tables in relational

* destination cap if create table if not exits supported

* generates IF NOT EXISTS for dlt tables

* adds logging for terminal and retry exception in run_managed of load job

* passes schema update to be collected in trace in filesystem

* fixes job log exception message
willi-mueller pushed a commit that referenced this pull request Sep 2, 2024
* uses normalized column names when linking tables in relational

* destination cap if create table if not exits supported

* generates IF NOT EXISTS for dlt tables

* adds logging for terminal and retry exception in run_managed of load job

* passes schema update to be collected in trace in filesystem

* fixes job log exception message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support This issue is monitored by Solution Engineer
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Prevent a race condition for the first run of pipelines that write in the same schema
2 participants