Skip to content

Commit

Permalink
Merge pull request dbt-labs#68 from fishtown-analytics/faster-unions
Browse files Browse the repository at this point in the history
short circuit parsing for introspective macros
  • Loading branch information
drewbanin authored Jun 12, 2018
2 parents 69490e2 + 1793e06 commit 77ba63d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions macros/schema_tests/equality.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{% macro test_equality(model, arg) %}


{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}
{%- if not execute -%}
{{ return('') }}
{% endif %}

-- setup

Expand Down
5 changes: 5 additions & 0 deletions macros/sql/star.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{% macro star(from, except=[]) -%}

{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}
{%- if not execute -%}
{{ return('') }}
{% endif %}

{%- if from.name -%}
{%- set schema_name, table_name = from.schema, from.name -%}
{%- else -%}
Expand Down
5 changes: 5 additions & 0 deletions macros/sql/union.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{% macro union_tables(tables, column_override=none, exclude=none) -%}

{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}
{%- if not execute -%}
{{ return('') }}
{% endif %}

{%- set exclude = exclude if exclude is not none else [] %}
{%- set column_override = column_override if column_override is not none else {} %}

Expand Down

0 comments on commit 77ba63d

Please sign in to comment.