Skip to content

DBT Test: Dbt Expectations Expect Table Aggregation To Equal Other Table Brazil Bol 2025 Silver Source Source Brazil Original Brazil Soy Beef Bol 2025 Count 0 03

DBT test name: dbt_expectations_expect_table_aggregation_to_equal_other_table_brazil_bol_2025_silver_source_source_brazil_original_brazil_soy_beef_bol_2025___count___0_03

DBT details


Description

No description


Details

Models

Sources

Macros

  • test_expect_table_aggregation_to_equal_other_table
  • get_where_subquery
{{ dbt_expectations.test_expect_table_aggregation_to_equal_other_table(**_dbt_generic_test_kwargs) }}{{ config(severity="warn",alias="dbt_expectations_expect_table__4dceb04a4a345c8966430e8d16ae5a1e") }}
    with a as (

    select

        count(*) as expression
    from
        "memory"."main"."brazil_bol_2025_silver"


    ),
    b as (

    select

        count(*) as expression
    from
        read_csv('s3://trase-storage/brazil/trade/bol/2025/bronze/brazil_bol_2025_soy_beef.csv', all_varchar=true)


    ),
    final as (

        select

            a.expression,
            b.expression as compare_expression,
            abs(coalesce(a.expression, 0) - coalesce(b.expression, 0)) as expression_difference,
            abs(coalesce(a.expression, 0) - coalesce(b.expression, 0))/
                nullif(a.expression * 1.0, 0) as expression_difference_percent
        from

            a cross join b

    )
    -- DEBUG:
    -- select * from final
    select
        *
    from final
    where

        expression_difference_percent > 0.03