Skip to content

Commit

Permalink
Merge pull request #188 from Teradata/main
Browse files Browse the repository at this point in the history
fixed the dbt show command (#187)
  • Loading branch information
tallamohan authored Aug 27, 2024
2 parents 9b2263e + 21e656d commit e630802
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions dbt/include/teradata/macros/show.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- This macro is overriden because limit keyword doesnot work in teradata database and has been replaced with top keyword
{% macro teradata__get_limit_subquery_sql(sql, limit) %}
select top {{ limit }} *
from (
{{ sql }}
) as model_limit_subq
-- This macro is overriden because limit keyword doesnot work in teradata database and has been replaced with sample keyword
{% macro teradata__get_limit_sql(sql, limit) %}
{{ compiled_code }}
{% if limit is not none %}
sample {{ limit }}
{%- endif -%}
{% endmacro %}
2 changes: 1 addition & 1 deletion tests/functional/adapter/test_dbt_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_limit(self, project, args, expected):
# ensure limit was injected in compiled_code when limit specified in command args
limit = results.args.get("limit")
if limit > 0:
assert f"top {limit}" in results.results[0].node.compiled_code #used top keyword in place of limit keyword
assert f"sample {limit}" in results.results[0].node.compiled_code #used sample keyword in place of limit keyword


class BaseShowSqlHeader:
Expand Down

0 comments on commit e630802

Please sign in to comment.