dbt-labs / dbt-spark

dbt-spark contains all of the code enabling dbt to work with Apache Spark and Databricks
https://getdbt.com
Apache License 2.0
406 stars 228 forks source link

[Feature] Removing the temporary view creation in favor of injecting the compiled SQL directly into the MERGE clause. #1114

Closed aiss93 closed 1 month ago

aiss93 commented 1 month ago

Is this your first time submitting a feature request?

Describe the feature

When using the merge strategy in the incremental materialization, we first create a VIEW then reference this view in the MERGE operation. Perhaps I'm missing something, but wouldn't be better to inject the compiled SQL directly in the MERGE clause.

Describe alternatives you've considered

This can be esaly modified in the macro/materialization/incremental/strategies.sql file.

Who will this benefit?

This is can benefecial for data engineers since they won't have the view object to manage in the database.

Are you interested in contributing this feature?

Yes

Anything else?

No response