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

drop bespoke mat, intro simpler macros #1

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

dataders
Copy link
Owner

@dataders dataders commented Oct 11, 2023

Resolves databricks#477 (partially)

I'm guessing that the CRUD macros for tables and views will also need to be added to get this working properly. See dbt-postgres's versions in the table/ and view/ directories within main/plugins/postgres/dbt/include/postgres/macros/relations. Other adapters (Snowflake, Redshift, and soon BQ) will have the same macros all will require this work

@@ -0,0 +1,3 @@
{% macro databricks__get_rename_materialized_view_sql(relation, new_name) %}
alter materialized view {{ relation }} rename to {{ new_name }}
Copy link

Choose a reason for hiding this comment

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

MVs in Databricks cannot be renamed. What should we do instead?

create materialized view if not exists {{ relation }} as {{ sql }};

{% for _index_dict in config.get('indexes', []) -%}
{{- get_create_index_sql(relation, _index_dict) -}}
Copy link

Choose a reason for hiding this comment

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

Databricks doesn't have traditional indexes.

@benc-db
Copy link

benc-db commented Oct 11, 2023

This is more what I was expecting. But are you saying even this is not required for 1.7.0? Or is this level what we need for 1.7.0, and the more substantial refactor is 1.7.x timeline?

@dataders dataders merged commit 789942b into mikanders_1.7.0 Oct 12, 2023
17 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants