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

Fix temporary table creation to support dbt unit tests #305

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions dbt/include/clickhouse/macros/materializations/table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
{% macro clickhouse__create_table_as(temporary, relation, sql) -%}
{% set has_contract = config.get('contract').enforced %}
{% set create_table = create_table_or_empty(temporary, relation, sql, has_contract) %}
{% if adapter.is_before_version('22.7.1.2484') -%}
{% if adapter.is_before_version('22.7.1.2484') or temporary -%}
{{ create_table }}
{%- else %}
{% call statement('create_table_empty') %}
Expand All @@ -159,8 +159,6 @@
{% if temporary -%}
create temporary table {{ relation }}
engine Memory
{{ order_cols(label="order by") }}
{{ partition_cols(label="partition by") }}
{{ adapter.get_model_settings(model) }}
as (
{{ sql }}
Expand Down