Is it possible to append a column value to column names?
For example, I have this so far:
{% for i in (0,1) %}
COLUMN1[{{ i }}]:version::string as version_{{ i }},
COLUMN1[{{ i }}]:created_at as created_at_{{ i }},
COLUMN1[{{ i }}]:some_id as some_id_{{ i }},
COLUMN1[{{ i }}]:some_string::string as some_string_{{ i }},
COLUMN1[{{ i }}]:status::string as status_{{ i }}
{% endfor %}
But would like to use the value in the version column and append it to the rest of the columns in the for loop, so that if the value of version is “new”, all of the column names end with “new”.
Is there a way to accomplish this?
I’ve looked into trying get_column_values from dbtutils, but I don’t think that’s going to work here.