forked from dbt-labs/dbt-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dbt-labs#100 from fishtown-analytics/feature/lengt…
…h-macro Feature: length macro
- Loading branch information
Showing
4 changed files
with
44 additions
and
0 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,5 @@ | ||
expression,output | ||
abcdef,6 | ||
fishtown,8 | ||
december,8 | ||
www.google.com/path,19 |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
with data as ( | ||
|
||
select * from {{ ref('data_length') }} | ||
|
||
) | ||
|
||
select | ||
|
||
{{ dbt_utils.length('expression') }} as actual, | ||
output as expected | ||
|
||
from data |
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 length(expression) -%} | ||
{{ adapter_macro('dbt_utils.length', expression) }} | ||
{% endmacro %} | ||
|
||
|
||
{% macro default__length(expression) %} | ||
|
||
length( | ||
{{ expression }} | ||
) | ||
|
||
{%- endmacro -%} | ||
|
||
|
||
{% macro redshift__length(expression) %} | ||
|
||
len( | ||
{{ expression }} | ||
) | ||
|
||
{%- endmacro -%} |