Skip to content

Commit

Permalink
include only lines that start with order by
Browse files Browse the repository at this point in the history
  • Loading branch information
prdpsvs committed Dec 1, 2024
1 parent 4d94cdd commit dd918ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dbt/include/fabric/macros/adapters/show.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{%- if limit == -1 or limit is none -%}
{{ sql }}
{#- Special processing if the last non-blank line starts with order by -#}
{%- elif 'order by' in sql.strip().splitlines()[-1].strip().lower() -%}
{%- elif sql.strip().splitlines()[-1].strip().lower().startswith('order by') -%}
{{ sql }}
offset 0 rows fetch first {{ limit }} rows only
{%- else -%}
Expand Down

0 comments on commit dd918ed

Please sign in to comment.