【问题标题】:DBT : Access Denied to Table dbt-tutorial:jaffle_shop.ordersDBT:拒绝访问表 dbt-tutorial:jaffle_shop.orders
【发布时间】:2022-01-09 22:41:44
【问题描述】:

当我遵循tutorial of dbt-CLI 时,我在运行dbt run 命令时访问BigQuery 上的数据集dbt-tutorial 存储时出错。

见下文:

$ dbt run
Running with dbt=0.21.1
Found 3 models, 4 tests, 0 snapshots, 0 analyses, 184 macros, 0 operations, 0 seed files, 0 sources, 0 exposures

15:01:05 | Concurrency: 1 threads (target='dev')
15:01:05 |
15:01:05 | 1 of 3 START table model dbt_username.customers........................ [RUN]
15:01:05 | 1 of 3 ERROR creating table model dbt_adrien.customers............... [ERROR in 0.74s]
15:01:05 | 2 of 3 START table model dbt_username.my_first_dbt_model............... [RUN]
15:01:08 | 2 of 3 OK created table model dbt_adrien.my_first_dbt_model.......... [CREATE TABLE (2.0 rows, 0.0 Bytes processed) in 2.39s]
15:01:08 | 3 of 3 START view model dbt_username.my_second_dbt_model............... [RUN]
15:01:09 | 3 of 3 OK created view model dbt_username.my_second_dbt_model.......... [OK in 0.97s]
15:01:09 |
15:01:09 | Finished running 2 table models, 1 view model in 4.88s.

Completed with 1 error and 0 warnings:

Database Error in model customers (models/customers.sql)
  Access Denied: Table dbt-tutorial:jaffle_shop.orders: User does not have permission to query table dbt-tutorial:jaffle_shop.orders.
  compiled SQL at target/run/jaffle_shop/models/customers.sql

Done. PASS=2 WARN=0 ERROR=1 SKIP=0 TOTAL=3

【问题讨论】:

    标签: google-bigquery dbt


    【解决方案1】:

    出现此错误可能是因为dbt-tutorial:jaffle_shop.orders 表在位置EU 中不可用。

    您应该在您的 dbt profiles.yml 中使用 location:US,并在创建 Big Query 帐户时将“治疗地点”设置为“美国”(否则您将遇到 404 错误)。

    如果您尝试在 Big Query UI 中使用“EU”位置运行请求,您将收到与 dbt-cli 中相同的错误:

    【讨论】:

    • 我在哪里可以从屏幕截图中找到设置治疗位置的屏幕?
    • 我可以在 bigquery 中运行查询,但在 dbt 中将处理位置设置给我们时,我收到了您在回答中提到的 404 错误。
    • 可以通过删除界面中已有的Views并执行dbt run来修复。
    猜你喜欢
    • 1970-01-01
    • 2022-07-08
    • 2021-11-01
    • 2022-10-05
    • 2022-11-11
    • 1970-01-01
    • 2021-12-22
    • 2021-06-20
    • 1970-01-01
    相关资源
    最近更新 更多