-
Notifications
You must be signed in to change notification settings - Fork 119
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
implementation guideline #468
Conversation
Please see tests failing re: hologram removal. |
@dataders is this ready for me to take over or do you still plan on another commit? |
not even close. 🥲 i'll be working on this more today and tomorrow. stay tuned. also |
51ecbae
to
142c3fb
Compare
sql = f""" | ||
select | ||
'table' as relation_type | ||
from pg_tables | ||
where schemaname = '{relation.schema}' | ||
and tablename = '{relation.identifier}' | ||
union all | ||
select | ||
case | ||
when definition ilike '%create materialized view%' | ||
then 'materialized_view' | ||
else 'view' | ||
end as relation_type | ||
from pg_views | ||
where schemaname = '{relation.schema}' | ||
and viewname = '{relation.identifier}' | ||
""" | ||
results = project.run_sql(sql, fetch="all") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikealfare how can I change this to use list_relations_without_caching()
instead? in my mind that's where this logic is already standardized.
in the case of dbt-databricks, it all the logic is in Python ( DatabricksAdapter.get_relations_without_caching()
. I'd rather not duplicate/reimplement it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the meantime, i suppose this is a decent woraround
select
'table' as relation_type
from information_schema.tables
where schemaname = '{relation.schema}'
and tablename = '{relation.identifier}'
union all
select
case when
is_materialized = TRUE then 'materialized_view'
else 'view'
end as relation_type
from information_schema.views
where schemaname = '{relation.schema}'
and viewname = '{relation.identifier}'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So long as its only used with the UC cluster...information schema isn't available on the non-uc cluster.
@dataders status update? At any point feel free to hand off and give me instructions on what is remaining :). |
7bc3932
to
fc8b3fb
Compare
e8a0611
to
0f6c616
Compare
@benc-db, after discussing internally, we're dropping this MV refactor work as a requirement for |
drop bespoke mat, intro simpler macros
Resolves #
Depends on: #471
Description
mostly worked on the python class tuff
Checklist
CHANGELOG.md
and added information about my change to the "dbt-databricks next" section.