techindicium / dbt-oracle

A dbt adapter for oracle db backend
Other
38 stars 18 forks source link

Relationship schema test not implemented #4

Closed dpavancini closed 4 years ago

dpavancini commented 4 years ago

Example test: image

Result:

image

fabrice-etanchaud commented 4 years ago

The AS keyword for table alias should be removed, one has to create a oracle specific relationships.sql file :

select count(*) as validation_errors
from (
    select {{ column_name }} as id from {{ model }}
) <<as>> child
left join (
    select {{ field }} as id from {{ to }}
) <<as>> parent on parent.id = child.id
where child.id is not null
  and parent.id is null

relationships.sql

fabrice-etanchaud commented 4 years ago

As of dbt 0.18.0, schema tests are using adapter dispatch scheme. The last pull request already contains an ad-hoc version of the schema_tests. IMHO one can close this issue !