-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
{% macro get_show_sql(compiled_code, sql_header, limit) -%} | ||
{%- if sql_header -%} | ||
{{ sql_header }} | ||
{%- endif -%} | ||
{%- if limit is not none -%} | ||
{%- set warn = "--limit is ignored. Synapse doesn't support the implementation" -%} | ||
{{ log(warn, info=True) }} | ||
{%- endif -%} | ||
{{ compiled_code }} | ||
|
||
{% endmacro %} | ||
|
||
{% macro get_limit_subquery_sql(sql, limit) %} | ||
{{ adapter.dispatch('get_limit_subquery_sql', 'dbt')(sql, limit) }} | ||
{% endmacro %} | ||
|
||
{# Synapse doesnt support ANSI LIMIT clause #} | ||
{% macro synapse__get_limit_subquery_sql(sql, limit) %} | ||
{%- set warn = "-- limit of " ~ limit ~ " is ignored. Synapse doesn't support the implementation" -%} | ||
|
||
{{ warn }} | ||
{{ sql }} | ||
|
||
select top {{ limit }} * | ||
from ( | ||
{{ sql }} | ||
) as model_limit_subq | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters