Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Example 13

{%- for col in table.columns -%}

    {%- if col.name == "City" -%}

        {%- set pv = getProfilingValues(col,"Top 10 most frequent values",true) -%}

        Top 10 most frequent values:{%br%}

        {%- for v in pv -%}

            {{loop.index + 1}}- {{v.fst}}: {{v.snd}}{%br%}

        {%- endfor -%}

    {%- endif -%}

{%- endfor -%}

Output

Top 10 most frequent values
1- London: 6
2- México D.F.: 5
3- Sao Paulo: 4
4- Rio de Janeiro: 3
5- Madrid: 3
6- Buenos Aires: 3
7- Paris: 2
8- Portland: 2
9- Nantes: 2
10- Lisboa: 2

...

The quote function convert any '`'s to the provided open and closing quotes.

Template

{{ quote("SELECT * FROM `TUTORIAL`.`CUSTOMER`;", "[", "]") }}

Output

SELECT * FROM [TUTORIAL].[CUSTOMER];

Anchor
_uniquetablename(table_table,_string_tab
_uniquetablename(table_table,_string_tab
uniqueTableName(Table table, String tableName, String schemaName)

The uniqueTableName function will return a String for a unique table name based on the provided names.

Example

{#- table is named TUTORIAL.CUSTOMER. And TUTORIAL.PRODUCT exists -#}

{{- uniqueTableName(table, "CUSTOMER", "TUTORIAL") -}}{%- br -%}
{{- uniqueTableName(table, "PRODUCT", "TUTORIAL") -}}

Output

CUSTOMER
PRODUCT_1