-
Notifications
You must be signed in to change notification settings - Fork 120
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
Support safe concurrent dbt runs #420
Comments
Hi, I think this is a good idea and would help my situation. 2 things to think about. 1 outstanding problem. To aid cleanup of hanging tables we could, the temporary tables could use timestamps rather than Re, naming with prefixes. Im not sure exactly what you mean but suffixes might be better than prefixes.
vs
Out of order runs Currently, these concurrent refreshes would each try and delete the I dont have a great solution for this that fits well with existing components, I dont think solving this needs to be a blocker. But worth considering as a downside. |
Support safe concurrent dbt runs
Description
There have been multiple issues related to concurrent dbt runs in ClickHouse, where one run attempts to query an intermediate/temp table that has already been dropped by a previous run.
Several PRs have attempted to fix this by appending
invocation_id
or UUIDs to table names or by implementing conditional drops based on specific criteria. However, each change was applied to different parts of the codebase based on individual use cases, resulting in an inconsistent and partial solution.Proposed Solution
Introduce dedicated macros,
clickhouse__make_intermediate_relation
andclickhouse__make_temp_relation
, that would:prefix
parameter with a default value usinginvocation_id
, ensuring unique table names for each dbt run.invocation_id
will be automatically appended to intermediate and temp table names.✅ Benefits
❌ Potential Downsides
This is not a heavy lift, but I Would love to get the community's opinion on it.
The text was updated successfully, but these errors were encountered: