Version:
sql_models.yaml
Write SQL queries in a Profile project.
less than a minute
You can write queries within the YAML file or in standalone sql files and reference them in the sql_template model. They have the same keys as an input model.
This data is saved in the model folder of a Profiles project, along with any referenced sql files.
models:
- name: name_of_sql_model
model_type: sql_template
model_spec:
<model-spec>
Example
models:
- name:
model_type: sql_template
model_spec:
single_sql: |
{% with input_table = this.DeRef("inputs/rsIDS) %}
select
id,
first,
last
from
{{input_table}}
where
id_type = 'email'
{% endwith %}
ids:
select: "id"
type: user_id
entity: user
