【发布时间】:2021-08-30 11:48:39
【问题描述】:
我正在尝试在我的 adapter.get_relation 中使用 Jinja 变量,但我无法这样做 :confused: 代码
{% set the_var = 'amazon_full_orders_denormalized_' ~ company_uuid %}
{{ log(the_var, info=True) }}
{%- set source_relation = adapter.get_relation(
database='282615',
schema='airbyte_mumbai',
identifier= the_var ) -%}
我正在使用的命令
dbt compile --vars '{"company_uuid":"0703afd3_496b_4ed5_8e0c_594b71f4718b","dataset":"airbyte_mumbai"}' --models tag:copy_reports
变量 the_var 被设置为amazon_full_orders_denormalized_
Found 6 models, 0 tests, 0 snapshots, 0 analyses, 165 macros, 0 operations, 0 seed files, 0 sources, 0 exposures
17:11:08 | Concurrency: 3 threads (target='dev')
17:11:08 |
amazon_full_orders_denormalized_
Table does not exist
17:11:08 | Done.
而我希望将其设置为 amazon_full_orders_denormalized_0703afd3_496b_4ed5_8e0c_594b71f4718b
【问题讨论】:
-
代替
identifier = the_var,试试这个identifier=the_var+var('company_uuid')。我认为company_uuid变量没有附加到变量the_var。