Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic test - "relationships" issue after with test setting limit #223

Open
zwbill82 opened this issue Dec 17, 2023 · 0 comments
Open

Generic test - "relationships" issue after with test setting limit #223

zwbill82 opened this issue Dec 17, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@zwbill82
Copy link

zwbill82 commented Dec 17, 2023

Describe the bug

14 of 15 ERROR relationships_dm_est_unit_economics_dbt_listing_id__listing_id__ref_stg_dm_unit_product_pool_online_ [ERROR in 0.45s]
Database Error in test relationships_dm_est_unit_economics_dbt_listing_id__listing_id__ref_stg_dm_unit_product_pool_online_ (models/dm_est_unit_economics/marts/_dm_est_unit_economics.yml)
Code: 62.
DB::Exception: Syntax error: failed at position 769 ('limit') (line 34, col 7): limit 100
) dbt_internal_test. Expected one of: UNION, EXCEPT, INTERSECT. Stack trace:

  1. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0xe11e335 in /usr/bin/clickhouse
  2. ? @ 0x8d1cc2d in /usr/bin/clickhouse

Steps to reproduce

  1. set global tests setting in dbt_project.yml
    `
    tests:
    +warn_if: ">20"
    +error_if: ">50"
    +limit: 100

2. add test like this:

  • name: listing_id
    tests:
    - unique:
    config:
    where: listing_id>0

      - relationships:
          to: ref('stg_dm_unit_product_pool_online')
          field: listing_id 
    

`

Expected behaviour

image

Code examples, such as models or profile settings

the run code is here, the limit clause is after the setting clause.
`select
count() as failures,
count(
) >20 as should_warn,
count(*) >50 as should_error
from (

with child as (
select listing_id as from_field
from dbt_dev.dm_est_unit_economics_dbt
where listing_id is not null
),

parent as (
select listing_id as to_field
from dbt_dev.stg_dm_unit_product_pool_online
)

select
from_field

from child
left join parent
on child.from_field = parent.to_field

where parent.to_field is null
settings join_use_nulls = 1

  limit 100
) dbt_internal_test

`
image

dbt and/or ClickHouse server logs

Configuration

Environment

  • dbt version: 1.7.4
  • dbt-clickhouse version: 1.7.1
  • clickhouse-driver version (if using native): 0.2.6
  • clickhouse-connect version (if using http):
  • Python version: 3.8
  • Operating system: MacOS

ClickHouse server

  • ClickHouse Server version:
  • ClickHouse Server non-default settings, if any:
  • CREATE TABLE statements for tables involved:
  • Sample data for these tables, use clickhouse-obfuscator if necessary
@zwbill82 zwbill82 added the bug Something isn't working label Dec 17, 2023
@BentsiLeviav BentsiLeviav self-assigned this Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants