-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configuring local tests to run on user credentials. Dropping a relati…
…on correctly based on its type
- Loading branch information
Showing
5 changed files
with
26 additions
and
33 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
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
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,24 +1,16 @@ | ||
{% macro fabric__get_limit_sql(sql, limit) %} | ||
|
||
{% if limit == -1 or limit is none %} | ||
{% if sql.strip().lower().startswith('with') %} | ||
with model_limit_subq as ( | ||
{{ sql }} | ||
{% else -%} | ||
select * | ||
from ( | ||
{{ sql }} | ||
) as model_limit_subq | ||
{%- endif -%} | ||
) | ||
select * | ||
from model_limit_subq; | ||
{% else -%} | ||
{% if sql.strip().lower().startswith('with') %} | ||
{{ sql }} order by (select null) | ||
offset 0 rows fetch first {{ limit }} rows only | ||
{% else -%} | ||
select * | ||
from ( | ||
{{ sql }} | ||
) as model_limit_subq order by (select null) | ||
offset 0 rows fetch first {{ limit }} rows only | ||
{%- endif -%} | ||
with model_limit_subq as ( | ||
{{ sql }} | ||
) | ||
select top {{ limit }} * | ||
from model_limit_subq; | ||
{%- endif -%} | ||
{% 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
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