-
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.
Merge pull request #236 from microsoft/backport_235_to_1.7.latest
[backport] 1.7 #230 [bug] disable `--limit` on `show` (again)
- Loading branch information
Showing
2 changed files
with
8 additions
and
17 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,23 +1,13 @@ | ||
{% 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) %} | ||
select top {{ limit }} * | ||
from ( | ||
{{ sql }} | ||
) as model_limit_subq | ||
{%- set warn = "-- limit of " ~ limit ~ " is ignored. Synapse doesn't support the implementation" -%} | ||
|
||
{{ warn }} | ||
{{ sql }} | ||
|
||
{% 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