如何在DBT项目中更改Google_ads模式?

发布于 2025-01-21 05:57:36 字数 646 浏览 2 评论 0原文

我有一个DBT项目,我正在使用AD_Reporting模型。 除Google_ads外,所有来源都很好。 那是因为我没有Google_ads架构,而是我有Google_ads_us架构。 我尝试在MAIN DBT_PROJECT.YML文件中更改它:

vars:
    google_ads_schema: google_ads_us

但是,当我运行此命令时,

dbt run --select ad_reporting

我仍然会获取此错误:

Database Error in model stg_google_ads (models\stg_google_ads.sql)
SQL compilation error:
Object 'DATABASE.HISTORY_GOOGLE_ADS.GOOGLE_ADS__URL_AD_ADAPTER' does not exist or not 
authorized.
compiled SQL at target\run\ad_reporting\models\stg_google_ads.sql

history_ prefix来自profiles.yml文件(schema)。

有人知道我需要在哪里更改模式吗?

I have a dbt project and I'm using ad_reporting model.
all the sources are working good, except than google_ads.
and that's because I don't have google_ads schema, instead I have google_ads_us schema.
I tried to change it in main dbt_project.yml file:

vars:
    google_ads_schema: google_ads_us

but still when I'm running this command:

dbt run --select ad_reporting

I keep get this error:

Database Error in model stg_google_ads (models\stg_google_ads.sql)
SQL compilation error:
Object 'DATABASE.HISTORY_GOOGLE_ADS.GOOGLE_ADS__URL_AD_ADAPTER' does not exist or not 
authorized.
compiled SQL at target\run\ad_reporting\models\stg_google_ads.sql

the HISTORY_ prefix is from profiles.yml file (SCHEMA).

Anyone know where else I need to change the schema?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

oО清风挽发oО 2025-01-28 05:57:36

为了使软件包找到已定义的指定vars,您需要做四件事,所有这些都在 docs

1。确保启用了Google_ads的ad_reporting - >

# inside your dbt_project.yml

vars:
  ad_reporting__google_ads_enabled: true

2。另外,请确保您让DBT知道在哪里寻找Google_ads原始数据

# inside your dbt_project.yml

vars:
  google_ads_database: your_database_name  # in our case, `raw`
  google_ads_schema: your_schema_name      # in our case, `google_ads`

3。定义DBT将在其中构建google_adsgoogle_ads_source - &gt的模型。

# inside your dbt_project.yml

models:
  google_ads:
    +schema: my_new_schema_name # leave blank for just the target_schema
  google_ads_source:
    +schema: my_new_schema_name # leave blank for just the target_schema

由于根据文档的规定:

“默认情况下,此软件包将在标题(< target_schema> + _Stg_google_ads)和Google Ads最终模型的架构中构建Google广告登台模型,并具有标题为(< target_schema> gt; gt; + _google_ads)在您的目标数据库中。“

4。指定您要使用的API(Google AdWords或Google Ads)

# inside your dbt_project.yml

vars:
    api_source: google_ads  # adwords by default and is case sensitive!

For the package to find the specified vars it has defined, you will need to do four things, all specified in the docs:

1. Make sure that ad_reporting for google_ads is enabled -->

# inside your dbt_project.yml

vars:
  ad_reporting__google_ads_enabled: true

2. Also, make sure that you let dbt know where to look for the google_ads raw data:

# inside your dbt_project.yml

vars:
  google_ads_database: your_database_name  # in our case, `raw`
  google_ads_schema: your_schema_name      # in our case, `google_ads`

3. Define the schemas where dbt will build the models for both google_ads and google_ads_source -->

# inside your dbt_project.yml

models:
  google_ads:
    +schema: my_new_schema_name # leave blank for just the target_schema
  google_ads_source:
    +schema: my_new_schema_name # leave blank for just the target_schema

Since, as according to the docs:

"By default this package will build the Google Ads staging models within a schema titled (<target_schema> + _stg_google_ads) and the Google Ads final models with a schema titled (<target_schema> + _google_ads) in your target database."

4. Specify which API you're going to use (Google Adwords or Google Ads):

# inside your dbt_project.yml

vars:
    api_source: google_ads  # adwords by default and is case sensitive!
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文