admin管理员组文章数量:1313187
Currently i have a 2 table :
PRODUCTS (which is having PRD_ID, PRD_NAME, PRD_VERSION,PRD_CATEGORY, PRD_PRICE columns) TRANSACTIONS (which is having TR_ID,TR_DATE,TR_LINE_ID,TR_PRD_ID,TR_PRD_QTY column
PRD_ID Is primary key in Products table and TR_ID is primary key in Transactions table. TR_PRD_ID is foreign key representing PRD_ID column from Products table.
I have set up dbt tests in schema.yml file as below:
version: 2
sources:
- name: sources_demo
database: hands_on_demo
schema: seeds_demo
tables:
- name: src_transactions
identifier: TRANSACTIONS
description: "transactions details"
columns:
- name: TR_ID
tests:
- unique
- not_null
- name: TR_LINE_ID
- not_null
- name: TR_PRD_ID
- not_null
- relationships:
to: source('sources_demo','src_products')
field: PRD_ID
- name: TR_PRD_QTY
- not_null
tests:
- unique:
column_name: "TR_ID ||'-'|| TR_LINE_ID"
- name: src_products
identifier: PRODUCTS
description: "All Products details"
columns:
- name: PRD_ID
tests:
- unique
- not_null
- name: PRD_PRICE
tests:
- not_null
- name: PRD_CATEGORY
tests:
- not_null
- accepted_values:
values: ['Charger', 'Mobile', 'SmartWatch']
Every time i am running i am getting below error :
11:47:59 Registered adapter: snowflake=1.7.1
11:47:59 Encountered an error:
Parsing Error
Error reading dbthandson: sources.yml - Runtime Error
Syntax error near line 20
------------------------------
17 | - not_null
18 | - name: TR_PRD_ID
19 | - not_null
20 | - relationships:
21 | to: source('sources_demo','src_products')
22 | field: PRD_ID
23 | - name: TR_PRD_QTY
Raw Error:
------------------------------
mapping values are not allowed in this context
in "<unicode string>", line 20, column 32
what is the issue here ?? What am i doing wrong ?
本文标签: snowflake cloud data platformDBT Relationships test in DBT between two source tablesStack Overflow
版权声明:本文标题:snowflake cloud data platform - DBT: Relationships test in DBT between two source tables - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741921953a2405056.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论