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

Validation on incremental strategies does not allow for custom strategies #783

Open
Ruth-wj opened this issue Sep 3, 2024 · 4 comments
Open
Labels
bug Something isn't working

Comments

@Ruth-wj
Copy link

Ruth-wj commented Sep 3, 2024

Describe the bug

Custom strategies are supported in dbt-core and allow users to write macros that define incremental merge startegies ( https://docs.getdbt.com/docs/build/incremental-strategy#custom-strategies ). As long as the strategy macro is found in the namespace, it can be used.

The databricks adapter, however, overrides this functionality. A validation function is used which hardcodes only the builtin incremental strategies, constraining the user unnecessarily. The validation function is here:

{% if raw_strategy not in ['append', 'merge', 'insert_overwrite', 'replace_where'] %}

Personally I have overridden this validation function to include my custom merge strategies, but obviously this isn't ideal.

Steps To Reproduce

Implement custom merge strategy following dbt documentation

Expected behavior

Custom merge strategy should be usable provided they are in the namespace

@Ruth-wj Ruth-wj added the bug Something isn't working label Sep 3, 2024
@benc-db
Copy link
Collaborator

benc-db commented Sep 12, 2024

I'm fairly sure we imported/inherited this behavior from dbt-spark. At this point I have no idea why the limitation exists, so I will discuss with my team about lifting it.

@mcowart123
Copy link

Same issue: 753

@mcowart123
Copy link

Has there been any discussion had/movement on this?

@benc-db
Copy link
Collaborator

benc-db commented Oct 15, 2024

I'm in favor of removing the limitation, but haven't had time to comb the code to understand impact. There may be a couple of places where we assume a fixed set of strategies and make some assertions based on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants