Skip to content

Commit

Permalink
Use dispatch pattern for get_columns_in_relation_raw macro. (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
ueshin authored May 31, 2022
1 parent 8744cf1 commit 4c41d9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dbt/adapters/spark/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

logger = AdapterLogger("Spark")

GET_COLUMNS_IN_RELATION_RAW_MACRO_NAME = "spark__get_columns_in_relation_raw"
GET_COLUMNS_IN_RELATION_RAW_MACRO_NAME = "get_columns_in_relation_raw"
LIST_SCHEMAS_MACRO_NAME = "list_schemas"
LIST_RELATIONS_MACRO_NAME = "list_relations_without_caching"
DROP_RELATION_MACRO_NAME = "drop_relation"
Expand Down
4 changes: 4 additions & 0 deletions dbt/include/spark/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@
{%- endcall -%}
{% endmacro %}

{% macro get_columns_in_relation_raw(relation) -%}
{{ return(adapter.dispatch('get_columns_in_relation_raw', 'dbt')(relation)) }}
{%- endmacro -%}

{% macro spark__get_columns_in_relation_raw(relation) -%}
{% call statement('get_columns_in_relation_raw', fetch_result=True) %}
describe extended {{ relation.include(schema=(schema is not none)) }}
Expand Down

0 comments on commit 4c41d9e

Please sign in to comment.