-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
1 parent
5182e3c
commit 40d6db1
Showing
2 changed files
with
30 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% macro show(limit) -%} | ||
{%- set sql_header = config.get('sql_header', none) -%} | ||
{{ sql_header if sql_header is not none }} | ||
{%- if limit is not none -%} | ||
{{ get_limit_subquery_sql(compiled_code, limit) }} | ||
{%- else -%} | ||
{{ compiled_code }} | ||
{%- endif -%} | ||
{% endmacro %} | ||
|
||
{% macro get_limit_subquery_sql(sql, limit) %} | ||
{{ adapter.dispatch('get_limit_subquery_sql', 'dbt')(sql, limit) }} | ||
{% endmacro %} | ||
|
||
{% macro default__get_limit_subquery_sql(sql, limit) %} | ||
select * | ||
from ( | ||
{{ sql }} | ||
) as model_limit_subq | ||
limit {{ limit }} | ||
{% 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